Skip to content

Commit f4b1e90

Browse files
authored
link checker - fails PR if links are broken - be consistent with llmd-scheduler (#70)
* add check for broken links in *.md files Signed-off-by: Maya Barnea <mayab@il.ibm.com> * move .lychee.toml to the root Signed-off-by: Maya Barnea <mayab@il.ibm.com> * broke a link in readme.md to check CI-CD workflow Signed-off-by: Maya Barnea <mayab@il.ibm.com> * fix the link in readme.md Signed-off-by: Maya Barnea <mayab@il.ibm.com> --------- Signed-off-by: Maya Barnea <mayab@il.ibm.com>
1 parent 797f81b commit f4b1e90

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/md-link-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Markdown Link Checker
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
lychee:
12+
name: Check Markdown Links
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install lychee v0.18.1
20+
run: |
21+
curl -Ls https://github.com/lycheeverse/lychee/releases/download/lychee-v0.18.1/lychee-x86_64-unknown-linux-gnu.tar.gz | tar xz
22+
sudo mv lychee /usr/local/bin
23+
- name: Run lychee on Markdown files with config
24+
run: |
25+
find . -name "*.md" -print0 | xargs -0 lychee --config .lychee.toml --verbose --no-progress

.lychee.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ignore transient failures on gnu.org (it sometimes refuses connections)
2+
exclude = [
3+
"^https://www.gnu.org/software/make/?$"
4+
]
5+
6+
# Timeout in seconds
7+
timeout = 20
8+
9+
# Retry failed links (helpful for flaky sites)
10+
retry_count = 3
11+
12+
# Accept non-200 status codes (429: rate limits)
13+
accept = [200, 429]

0 commit comments

Comments
 (0)