Skip to content

Commit 86e660f

Browse files
committed
basic link checker (no comment/pr/cron automation)
1 parent cab7d00 commit 86e660f

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

.github/workflows/link-checker.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .github/workflows/link-checker.yml
2+
3+
name: "🔗 Broken Link Checker"
4+
5+
on:
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
check-links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: "☁️ Checkout Repository"
14+
uses: actions/checkout@v4
15+
16+
- name: "🔎 Run Link Checker"
17+
uses: lycheeverse/lychee-action@v2
18+
with:
19+
args: "--config ./lychee.toml ./src/content/**/*.md*"
20+
# Do not show failed
21+
fail: false
22+
env:
23+
# Required to check GitHub links without being rate-limited
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.lycheerc

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This file is used by the Lychee link checker to validate links in the documentation.
2+
# The GH action is configured to check documentation source files (./src/content/**/*.md*)
3+
# The exclude section below contains patterns to ignore certain links that are known to be problematic/not relevant
4+
# Most notably, blockchain explorers, API endpoints that require authentication, and other support services that block bots or require login
5+
6+
############################# Display #############################
7+
# Show informational output during the run
8+
verbose = "error"
9+
no_progress = false
10+
11+
############################# Runtime #############################
12+
# Temporarily accept 429 -- rate limiting by gnu.org is very aggressive!!
13+
accept = '200, 202, 429'
14+
15+
# Disable caching for clean test runs.
16+
cache = false
17+
18+
max_concurrency = 10
19+
max_retries = 3
20+
retry_wait_time = 5
21+
22+
############################# Requests ############################
23+
base_url = "https://docs.chain.link/"
24+
timeout = 20
25+
26+
############################# Exclusions ##########################
27+
28+
# Exclude private, local, and loopback
29+
exclude_all_private = true
30+
31+
exclude = [
32+
# Blockchain Explorers (which cause 403 Forbidden errors)
33+
".*scan\\.com",
34+
".*scan\\.dev",
35+
".*scan\\.io",
36+
".*scan\\.xyz",
37+
"basescan\\.org",
38+
"snowtrace\\.io",
39+
"celoscan\\.io",
40+
"explorer\\.celo\\.org",
41+
"explorer\\.metis\\.io",
42+
"docs\\.polygon\\.technology",
43+
44+
# Other Services That Block Bots or Require Login
45+
"infura\\.io",
46+
"stackoverflow\\.com",
47+
"ethereum\\.stackexchange\\.com",
48+
"support\\.metamask\\.io",
49+
"support\\.chainstack\\.com",
50+
"faucet\\.polygon\\.technology",
51+
"www\\.forex\\.com",
52+
"debridges\\.com",
53+
"help\\.phantom\\.app",
54+
"app\\.roninchain\\.com",
55+
"www\\.tronlink\\.org",
56+
57+
# API endpoints that require authentication
58+
"api\\.dataengine\\.chain\\.link",
59+
"api\\.testnet-dataengine\\.chain\\.link",
60+
"app\\.dev3\\.sh", # Requires payment
61+
62+
# Common Local & Invalid Patterns
63+
"^http://(localhost|127\\.0\\.0\\.1)(:\\d+)?",
64+
"mailto:",
65+
]
66+

0 commit comments

Comments
 (0)