File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,6 @@ name: Markdown Lint
22
33on :
44 pull_request :
5- paths :
6- - ' **.md'
7- - ' **.mdx'
8- - ' .markdownlint-cli2.jsonc'
9- - ' .github/workflows/markdown-lint.yml'
105
116permissions :
127 contents : read
1914 steps :
2015 - name : Checkout code
2116 uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Get changed markdown files
21+ id : changed-files
22+ uses : tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
23+ with :
24+ files : |
25+ **/*.md
26+ **/*.mdx
27+ .markdownlint-cli2.jsonc
28+ .github/workflows/markdown-lint.yml
2229
2330 - name : Run markdownlint-cli2
24- uses : DavidAnson/markdownlint-cli2-action@v21
31+ if : steps.changed-files.outputs.any_changed == 'true'
32+ uses : DavidAnson/markdownlint-cli2-action@30a0e04f1870d58f8d717450cc6134995f993c63
2533 with :
26- globs : ' **/*.{md,mdx} '
34+ globs : ${{ steps.changed-files.outputs.all_changed_files }}
2735 config : ' .markdownlint-cli2.jsonc'
36+
37+ - name : Skip if no markdown files changed
38+ if : steps.changed-files.outputs.any_changed != 'true'
39+ run : echo "No markdown files changed, skipping lint"
You can’t perform that action at this time.
0 commit comments