From 2ff49fea67bf377fc927f364ed296d01c4bed205 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 7 Dec 2023 11:53:04 -0800 Subject: [PATCH 1/2] Edit github workflow for documentation previews --- .github/workflows/docs-preview-links.yml | 27 +++++++++--------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docs-preview-links.yml b/.github/workflows/docs-preview-links.yml index 79ea1de77..2284df8a6 100644 --- a/.github/workflows/docs-preview-links.yml +++ b/.github/workflows/docs-preview-links.yml @@ -1,26 +1,19 @@ -name: Docs Preview Links +name: docs-preview on: pull_request_target: types: [opened] - paths: - - '**.asciidoc' + +permissions: + pull-requests: write jobs: - doc-preview: + doc-preview-pr: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v6 - name: Add doc preview links + - uses: elastic/docs/.github/actions/docs-preview@master with: - script: | - const pr = context.payload.pull_request; - const comment = `Documentation preview: - - ✨ [Changed pages](https://${context.repo.repo}_${pr.number}.docs-preview.app.elstc.co/diff)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment, - }); \ No newline at end of file + github-token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.event.repository.name }} + preview-path: 'guide/index.html' + pr: ${{ github.event.pull_request.number }} \ No newline at end of file From c9fe55a91e15cb2c389ea179da4584d72eb92f2c Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 8 Dec 2023 09:17:29 -0800 Subject: [PATCH 2/2] Re-add paths clause --- .github/workflows/docs-preview-links.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-preview-links.yml b/.github/workflows/docs-preview-links.yml index 2284df8a6..b850bc5c9 100644 --- a/.github/workflows/docs-preview-links.yml +++ b/.github/workflows/docs-preview-links.yml @@ -3,7 +3,8 @@ name: docs-preview on: pull_request_target: types: [opened] - + paths: + - '**.asciidoc' permissions: pull-requests: write