Skip to content

Commit dcd7143

Browse files
authored
Merge pull request #668 from VisLab/update_hed_cache
Added a link checker for md files
2 parents 3a9e7db + cdc381d commit dcd7143

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/links.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Lychee link checker
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
# Run weekly on Sundays at 3 AM UTC to catch broken links
8+
- cron: '0 3 * * 0'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
link-checker:
15+
name: Lychee link checker
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Link Checker
23+
id: lychee
24+
uses: lycheeverse/lychee-action@v2.8.0
25+
with:
26+
# Check all Markdown files in the repository
27+
args: --config lychee.toml --verbose --no-progress --max-redirects 10 '**/*.md'
28+
fail: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
coverage
22
node_modules
33
.directory
4+
.github/copilot-instructions.md
45
.idea
56
dist/
67
/venv/

lychee.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Lychee link checker configuration
2+
# This file configures how lychee validates links in the repository
3+
#
4+
# For more information about lychee configuration, see:
5+
# https://github.com/lycheeverse/lychee#configuration
6+
#
7+
# This configuration addresses false positive errors from the link checker:
8+
# - 403 Forbidden: Some sites (shields.io, qlty.sh) block automated requests
9+
# but work fine in browsers
10+
# - 429 Too Many Requests: Rate limiting doesn't mean the link is broken
11+
12+
# Accept these HTTP status codes as valid
13+
# 200: OK (standard success)
14+
# 204: No Content (valid response with no body)
15+
# 206: Partial Content (valid for range requests)
16+
# 403: Forbidden (some sites block automated requests but links work in browsers)
17+
# 429: Too Many Requests (rate limiting, link may be valid)
18+
accept = [200, 204, 206, 403, 429]
19+
20+
# Timeout for requests (in seconds)
21+
timeout = 30
22+
23+
# Maximum number of retries per link
24+
max_retries = 3
25+
26+
# Maximum number of concurrent network requests
27+
max_concurrency = 8
28+
29+
# User agent string to use for requests
30+
# Some sites require a browser-like user agent to avoid blocking
31+
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0"
32+
33+
# Exclude URL patterns from link checking
34+
exclude = [
35+
'^http://127\.0\.0\.',
36+
'^http://localhost',
37+
'^https://localhost',
38+
'^file://',
39+
]

0 commit comments

Comments
 (0)