From 0a38581e8cbc5b1d57d73b964008a120b2550be1 Mon Sep 17 00:00:00 2001 From: Brandon Morelli Date: Thu, 8 Feb 2024 08:40:47 -0800 Subject: [PATCH] Update and rename doc-preview.yml to docs-preview.yml --- .github/workflows/doc-preview.yml | 28 ---------------------------- .github/workflows/docs-preview.yml | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/doc-preview.yml create mode 100644 .github/workflows/docs-preview.yml diff --git a/.github/workflows/doc-preview.yml b/.github/workflows/doc-preview.yml deleted file mode 100644 index 3a9a0bf5ac..0000000000 --- a/.github/workflows/doc-preview.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - pull_request_target: - types: [opened] - paths: - - '**.asciidoc' - - '**.jpg' - - '**.png' - - '**.gif' - -jobs: - doc-preview: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - name: Add doc preview links - with: - script: | - const pr = context.payload.pull_request; - const comment = `A documentation preview will be available soon: - - 📚 [HTML diff](https://${context.repo.repo}_${pr.number}.docs-preview.app.elstc.co/diff) - - 📙 [Observability Guide](https://${context.repo.repo}_${pr.number}.docs-preview.app.elstc.co/guide/en/observability/master/index.html)`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment, - }); diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml new file mode 100644 index 0000000000..8a197b9ad9 --- /dev/null +++ b/.github/workflows/docs-preview.yml @@ -0,0 +1,23 @@ +name: docs-preview +on: + pull_request_target: + types: [opened] + paths: + - '**.asciidoc' + - '**.jpg' + - '**.png' + - '**.gif' + +permissions: + pull-requests: write + +jobs: + doc-preview-pr: + runs-on: ubuntu-latest + steps: + - uses: elastic/docs/.github/actions/docs-preview@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.event.repository.name }} + preview-path: 'guide/index.html' + pr: ${{ github.event.pull_request.number }}