diff --git a/.github/workflows/docs-preview-links.yml b/.github/workflows/docs-preview-links.yml index 79ea1de7748a9..ba6e2397759b2 100644 --- a/.github/workflows/docs-preview-links.yml +++ b/.github/workflows/docs-preview-links.yml @@ -6,21 +6,15 @@ on: paths: - '**.asciidoc' +permissions: + pull-requests: write jobs: doc-preview: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v6 - name: Add doc preview links + - uses: elastic/docs/.github/actions/docs-preview@current 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/en/observability/master/index.html' + pr: ${{ github.event.pull_request.number }}