From 4a181150fcd1ffea235554962d3a29c1da3c61d9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 16:56:46 -0800 Subject: [PATCH] Edit github workflow for documentation previews (#2612) (#2619) (cherry picked from commit 37d19c5f949b2b51e69421ea614ac10d21946f84) Co-authored-by: Lisa Cawley --- .github/workflows/docs-preview-links.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docs-preview-links.yml b/.github/workflows/docs-preview-links.yml index 79ea1de77..b850bc5c9 100644 --- a/.github/workflows/docs-preview-links.yml +++ b/.github/workflows/docs-preview-links.yml @@ -1,26 +1,20 @@ -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