-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit github workflow for documentation previews (#2612)
(cherry picked from commit 37d19c5)
- Loading branch information
1 parent
7b38f8d
commit 2deb36d
Showing
1 changed file
with
9 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}); | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
repo: ${{ github.event.repository.name }} | ||
preview-path: 'guide/index.html' | ||
pr: ${{ github.event.pull_request.number }} |