Skip to content

ci: add a markdown link + badge checker for README and docs/#18

Merged
abtonmoy merged 2 commits into
tiliondev:mainfrom
abtonmoy:ci/markdown-link-checker
Jul 4, 2026
Merged

ci: add a markdown link + badge checker for README and docs/#18
abtonmoy merged 2 commits into
tiliondev:mainfrom
abtonmoy:ci/markdown-link-checker

Conversation

@abtonmoy

@abtonmoy abtonmoy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

The README and docs/ carry many links, shields.io badges, and raw-GitHub asset URLs (banner, release/checksum references). Dead links and dead badges are a common rot in public repos, and there was no guard — a moved file or renamed asset silently 404s for visitors. This adds a low-maintenance CI guard.

What it does

A new links workflow (.github/workflows/links.yml) runs lychee over README.md and docs/**/*.md:

  • Triggers: PRs that touch a *.md file (or the checker's own config), a weekly cron (Mondays 06:00 UTC) to catch external rot between PRs, and workflow_dispatch for manual runs.
  • Fails on hard 404s. Flaky / non-fetchable hosts are tolerated via .lycheeignore rather than left red.
  • Passes GITHUB_TOKEN so the many github.com links use the authenticated (higher) API rate limit.

.lycheeignore

Scoped to genuinely-flaky or non-fetchable endpoints; real content links stay checked:

Ignored Why
localhost / 127.0.0.1 Appear in code examples, not real links
img.shields.io, hub.docker.com, star-history.com Badge/image hosts that rate-limit CI crawlers; a stale badge is cosmetic
npmjs.com npm's registry returns 403 Forbidden to non-browser crawlers (bot protection); not fetchable from CI. PyPI serves crawlers fine and stays checked
chatgpt.com, claude.ai, gemini.google.com Interactive "ask an assistant" deep links that block bots / require login

Still checked: github.com, raw.githubusercontent.com, pypi.org, and the detector sites — so a moved file or renamed release asset is caught.

Docs

CONTRIBUTING.md now documents the workflow and the .lycheeignore escape hatch.

Verification

  • links.yml is valid YAML.
  • Every relative markdown link and local asset target in README.md / docs/ resolves to a real file (AGENTS.md, LICENSE, NOTICE, CHROMIUM_VERSION, docs/GAUNTLET_RESULTS.md, …).
  • Confirmed against a live run on this PR: lychee checked 64 URLs — the only failure was npm's 403 to crawlers, now tolerated via .lycheeignore; the re-run is green.
  • To confirm it catches regressions, add a deliberately-broken link in a test PR touching a *.md file — the job fails on the 404.

Closes #13

abtonmoy added 2 commits July 3, 2026 20:59
The README and docs/ carry many links, shields.io badges, and raw-GitHub
asset URLs. Dead links and dead badges are a common rot in public repos
and there was no guard, so a moved file or renamed asset would silently
404 for visitors.

Add a links workflow that runs lychee over README.md and docs/**/*.md:

- Triggers on PRs that touch a *.md file (plus the checker's own config)
  and on a weekly cron, with workflow_dispatch for manual runs.
- Hard 404s fail the job. Flaky or non-fetchable hosts are tolerated via
  .lycheeignore: localhost examples, shields.io / hub.docker.com /
  star-history badge hosts, and the interactive "ask an assistant" deep
  links (chatgpt.com / claude.ai / gemini.google.com) that block bots.
  Real content links (github.com, raw.githubusercontent.com, npm, pypi,
  the detector sites) stay checked.
- Uses GITHUB_TOKEN so the many github.com links don't hit the anonymous
  API rate limit.

Document the workflow and the .lycheeignore escape hatch in CONTRIBUTING.md.

Closes tiliondev#13
The first run failed only on https://www.npmjs.com/package/tilion-fortress,
which npm's registry returns 403 Forbidden to for non-browser clients as
bot protection — the package page is not fetchable from CI. Add npmjs.com
to .lycheeignore, the same tolerance already applied to the badge hosts.
PyPI serves crawlers fine and stays checked.
@abtonmoy abtonmoy merged commit 5a8b911 into tiliondev:main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add a markdown link + badge checker for README and docs/

1 participant