Skip to content

Commit aaab62b

Browse files
authored
Auto-generate preview links for DOC PRs (elastic#2219)
1 parent b724ec8 commit aaab62b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docs Preview Links
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
paths:
7+
- '**.asciidoc'
8+
9+
jobs:
10+
doc-preview:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/github-script@v6
14+
name: Add doc preview links
15+
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+
});

0 commit comments

Comments
 (0)