Skip to content

Commit a8e84c1

Browse files
mergify[bot]lcawl
andauthored
Edit github workflow for documentation previews (#2612) (#2614)
(cherry picked from commit 37d19c5) Co-authored-by: Lisa Cawley <[email protected]>
1 parent 5e56cb9 commit a8e84c1

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed
Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
name: Docs Preview Links
1+
name: docs-preview
22

33
on:
44
pull_request_target:
55
types: [opened]
66
paths:
77
- '**.asciidoc'
8+
permissions:
9+
pull-requests: write
810

911
jobs:
10-
doc-preview:
12+
doc-preview-pr:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/github-script@v6
14-
name: Add doc preview links
15+
- uses: elastic/docs/.github/actions/docs-preview@master
1516
with:
16-
script: |
17-
const pr = context.payload.pull_request;
18-
const comment = `Documentation preview:
19-
- ✨ [Changed pages](https://${context.repo.repo}_${pr.number}.docs-preview.app.elstc.co/diff)`;
20-
21-
github.rest.issues.createComment({
22-
issue_number: context.issue.number,
23-
owner: context.repo.owner,
24-
repo: context.repo.repo,
25-
body: comment,
26-
});
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
repo: ${{ github.event.repository.name }}
19+
preview-path: 'guide/index.html'
20+
pr: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)