File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,20 @@ jobs:
23
23
# source: https://stackoverflow.com/a/74268200
24
24
run : |
25
25
if ${{ github.event_name == 'pull_request' }}; then
26
- changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)
26
+ changed_files=$(git diff --name-only -r HEAD^1 HEAD -z | grep '\.md$' -zZ | xargs -0 )
27
27
else
28
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)
28
+ changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} -z | grep '\.md$' -zZ | xargs -0 )
29
29
fi
30
- # filter out non-markdown files
31
- md_files=$(echo "$changed_files" | grep -E '\.md$')
32
- echo "changed_files: $md_files"
33
- echo "changed_files=$md_files" >> $GITHUB_ENV
30
+ echo "changed_files: $changed_files"
31
+ echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
34
32
- name : Lint
35
33
uses : avto-dev/markdown-lint@v1
36
34
with :
37
35
args : ' .'
38
36
config : ' .markdownlint.json'
39
37
- name : Check links
40
38
uses :
lycheeverse/[email protected]
39
+ if : ${{ steps.changed-files.outputs.changed_files != '' }}
41
40
with :
42
41
fail : true
43
42
args : --verbose --no-progress --accept '100..=103,200..=299,300..=399' ${{ steps.changed-files.outputs.changed_files }}
You can’t perform that action at this time.
0 commit comments