File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -3,27 +3,27 @@ name: Comment on PR for .asciidoc changes
33on :
44 workflow_call : ~
55
6+ permissions :
7+ contents : read
8+ pull-requests : write
9+
610jobs :
711 comment-on-asciidoc-change :
812 runs-on : ubuntu-latest
913
1014 steps :
1115 - name : Checkout the repository
1216 uses : actions/checkout@v4
13- with :
14- fetch-depth : 0 # This is important to fetch all history
1517
16- - name : Check for changes in .asciidoc files
18+ - name : Get changed files
1719 id : check-files
18- run : |
19- git fetch origin ${{ github.base_ref }}
20- if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -E '\.asciidoc$'; then
21- echo "asciidoc_changed=true" >> $GITHUB_OUTPUT
22- else
23- echo "asciidoc_changed=false" >> $GITHUB_OUTPUT
24- fi
20+ uses : tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
21+ with :
22+ files : |
23+ **/*.asciidoc
24+
2525 - name : Add a comment if .asciidoc files changed
26- if : steps.check-files.outputs.asciidoc_changed == 'true'
26+ if : steps.check-files.outputs.any_changed == 'true'
2727 uses : actions/github-script@v6
2828 with :
2929 script : |
You can’t perform that action at this time.
0 commit comments