[DOCS] Add buildkite links to doc preview comments (#175463)

This commit is contained in:
Lisa Cawley 2024-01-24 16:52:58 -08:00 committed by GitHub
parent 3f02a72556
commit 88e81bf931
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
});
github-token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.event.repository.name }}
preview-path: 'guide/en/observability/master/index.html'
pr: ${{ github.event.pull_request.number }}