Skip to content

Commit c45edc6

Browse files
authored
ci: add markdown link checker workflow (#323)
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
1 parent cf2be0f commit c45edc6

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/link-check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Checks all Markdown files for broken links (internal and external).
2+
# Uses lychee (https://github.com/lycheeverse/lychee) with configuration
3+
# from .lychee.toml at the repository root.
4+
5+
name: Link Check
6+
7+
on:
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
link-check:
16+
name: Check Markdown links
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
21+
- uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
22+
with:
23+
args: >-
24+
--no-progress
25+
'**/*.md'
26+
fail: true

.lychee.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Configuration for lychee link checker
2+
# https://lychee.cli.rs/configuration/
3+
4+
# General settings
5+
max_concurrency = 32
6+
timeout = 30
7+
max_retries = 3
8+
retry_wait = 5
9+
10+
# Accept these HTTP status codes as valid
11+
accept = [200, 429]
12+
13+
# Exclude patterns for known false positives
14+
exclude = [
15+
# Placeholder / example URLs
16+
"example\\.com",
17+
"example\\.org",
18+
"example\\.net",
19+
20+
# Localhost and private networks
21+
"localhost",
22+
"127\\.0\\.0\\.1",
23+
"0\\.0\\.0\\.0",
24+
25+
# npm registry (frequently rate-limits CI)
26+
"npmjs\\.com",
27+
28+
# PyPI (frequently rate-limits CI)
29+
"pypi\\.org/project",
30+
31+
# Microsoft login / auth endpoints (require authentication)
32+
"login\\.microsoftonline\\.com",
33+
"portal\\.azure\\.com",
34+
35+
# GitHub special URLs that require authentication or don't resolve in CI
36+
"github\\.com/.*/compare/",
37+
"github\\.com/.*/releases/new",
38+
]
39+
40+
# Exclude email addresses from checking
41+
exclude_mail = true

0 commit comments

Comments
 (0)