Skip to content

Commit 6ce1cae

Browse files
committed
Add reusable workflow and usage example
1 parent 552b631 commit 6ce1cae

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

docs/source/migration/freeze/gh-action.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,11 @@ on:
2424
- master
2525
- "9.0"
2626

27+
permissions:
28+
contents: read
29+
pull_request: write
30+
2731
jobs:
2832
comment-on-asciidoc-change:
29-
runs-on: ubuntu-latest
30-
31-
steps:
32-
- name: Checkout the repository
33-
uses: actions/checkout@v3
34-
35-
- name: Check for changes in .asciidoc files
36-
id: check-files
37-
run: |
38-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.asciidoc$'; then
39-
echo "asciidoc_changed=true" >> $GITHUB_ENV
40-
else
41-
echo "asciidoc_changed=false" >> $GITHUB_ENV
42-
fi
43-
44-
- name: Add a comment if .asciidoc files changed
45-
if: env.asciidoc_changed == 'true'
46-
uses: actions/github-script@v6
47-
with:
48-
script: |
49-
github.rest.issues.createComment({
50-
owner: context.repo.owner,
51-
repo: context.repo.repo,
52-
issue_number: context.payload.pull_request.number,
53-
body: 'It looks like this PR modifies one or more `.asciidoc` files. The documentation is currently under a documentation freeze. Please do not merge this PR. See [link](link) to learn more.'
54-
});
55-
```
33+
uses: elastic/docs-builder/.github/workflows/comment-on-asciidoc-changes.yml@main
34+
```

0 commit comments

Comments
 (0)