Skip to content

Commit 129362d

Browse files
wksqinsoon
andauthored
Fix lychee command (#1286)
Removed `--base`. All relative URLs in Markdown are relative to the file itself. Increased verbosity to print the checked URLs and redirections. Excluded `dl.acm.org`. It always responses 403 when using Lychee to check links. --------- Co-authored-by: Yi Lin <[email protected]>
1 parent c4f5a02 commit 129362d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/link-check.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,26 @@ jobs:
1717
key: cache-lychee-${{ github.sha }}
1818
restore-keys: cache-lychee-
1919
- name: Check links in docs/*.md
20-
uses: lycheeverse/lychee-action@v1.9.3
20+
uses: lycheeverse/lychee-action@v2
2121
with:
2222
fail: true
2323
token: ${{ secrets.GITHUB_TOKEN }}
24-
args: --base docs --accept '200,201,202,203,204,429,500' --no-progress --cache --max-cache-age 1d './docs/**/*.md' --exclude https://users.cecs.anu.edu.au/~steveb/pubs/papers/**
24+
args:
25+
# Notes:
26+
# - Do not use `--base`. All relative URLs in Markdown are based on the file itself.
27+
# - Verbosity level 2 enables debug logs and shows redirections.
28+
# - Exclude dl.acm.org because it responses 403.
29+
# According to the YAML syntax,
30+
# the following lines will be concatenated into one single YAML string,
31+
# which is intended because the `args:` argument of the lychee-action takes one single string.
32+
--accept '200..=204,429,500'
33+
--verbose --verbose
34+
--no-progress
35+
--cache
36+
--max-cache-age 1d
37+
--exclude 'https://users.cecs.anu.edu.au/~steveb/pubs/papers/**'
38+
--exclude 'https://dl.acm.org/**'
39+
'./docs/**/*.md'
2540
- name: Save lychee cache
2641
uses: actions/cache/save@v4
2742
if: always()

0 commit comments

Comments
 (0)