Skip to content

Commit 5c9b1a3

Browse files
committed
test new
1 parent ede4421 commit 5c9b1a3

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/check-links.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,34 @@ jobs:
88

99
steps:
1010
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Get changed files
15+
id: changed-files
16+
uses: tj-actions/changed-files@v44
17+
with:
18+
files: |
19+
**/*.md
20+
**/*.html
21+
**/*.json
22+
separator: " "
1123

12-
- name: Check links
24+
- name: Check links in changed files
1325
id: lychee
26+
if: steps.changed-files.outputs.any_changed == 'true'
1427
uses: lycheeverse/lychee-action@v2
1528
with:
1629
fail: false
1730
format: "json"
1831
output: "results.json"
1932
args: |
20-
--include '.*\.md$'
21-
--include '.*\.html$'
2233
--verbose
23-
.
34+
${{ steps.changed-files.outputs.all_changed_files }}
35+
36+
- name: Create empty results if no files changed
37+
if: steps.changed-files.outputs.any_changed == 'false'
38+
run: echo '[]' > results.json
2439

2540
- name: Publish link check report
2641
uses: mikepenz/action-junit-report@v6

0 commit comments

Comments
 (0)