Skip to content

Commit 6fe6ba3

Browse files
authored
Updated configuration for the lychee link checker a.o.
Updated configuration for the lychee link checker Set max redirects to 2 Added .lycheeignore file to filter out known false positive errors.
2 parents 3c61ccb + 0cbb82a commit 6fe6ba3

2 files changed

Lines changed: 53 additions & 5 deletions

File tree

.github/workflows/link-check.yml

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,65 @@ on:
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+
1425
jobs:
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') }}

.lycheeignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Known intentional bad example
2+
3+
4+
# Known false positive / environment-sensitive
5+
https://www.raspberrypi.com/software
6+
https://www.raspberrypi.com/software/
7+
https://www.st.com/en/embedded-software/x-cube-stl.html

0 commit comments

Comments
 (0)