44 pull_request :
55 paths :
66 - " profile/**/*.md"
7+ - " .lycheeignore"
8+ - " .github/workflows/link-check.yml"
9+
710 push :
811 paths :
912 - " profile/**/*.md"
13+ - " .lycheeignore"
14+ - " .github/workflows/link-check.yml"
15+
1016 schedule :
1117 - cron : " 0 20 * * 0" # Sundays 20:00 UTC
18+
1219 workflow_dispatch :
1320
21+ concurrency :
22+ group : lychee-${{ github.ref }}
23+ cancel-in-progress : true
24+
1425jobs :
1526 link-check :
1627 runs-on : ubuntu-latest
1728 permissions :
18- issues : write # Required for peter-evans/create-issue-from-file
29+ contents : read
1930
2031 steps :
21- - uses : actions/checkout@v5
32+ - uses : actions/checkout@v6
2233
23- - name : Check links in md files
34+ # Using a progressive relaxation strategy that maximizes cache reuse without breaking correctness.
35+ - name : Restore lychee cache
36+ id : lychee-cache
37+ uses : actions/cache/restore@v5
38+ with :
39+ path : .lycheecache
40+ key : lychee-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('.lycheeignore', 'profile/**/*.md') }}
41+ restore-keys : |
42+ lychee-${{ runner.os }}-${{ github.ref_name }}-
43+ lychee-${{ runner.os }}-
44+
45+ - name : Check links in Markdown files
2446 uses : lycheeverse/lychee-action@v2
2547 with :
26- # Only check markdown in the profile folder
27- args : --root-dir "$(pwd)" --verbose --no-progress --accept 200,206,429 --timeout 20 --max-retries 2 "profile/**/*.md"
48+ token : ${{ secrets.GITHUB_TOKEN }}
49+ fail : true
50+ args : >
51+ --root-dir "$(pwd)"
52+ --no-progress
53+ --cache
54+ --max-cache-age 1d
55+ --accept 200,206,429
56+ --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
57+ --user-agent "curl/8.4.0"
58+ --timeout 20
59+ --max-retries 2
60+ --max-redirects 2
61+ "profile/**/*.md"
62+
63+ - name : Save lychee cache
64+ if : always() && steps.lychee-cache.outputs.cache-hit != 'true'
65+ uses : actions/cache/save@v5
66+ with :
67+ path : .lycheecache
68+ key : lychee-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('.lycheeignore', 'profile/**/*.md') }}
0 commit comments