Skip to content

ci: harden the link check so it fails only on real breakage - #7

Merged
adamXbot merged 1 commit into
mainfrom
ci/harden-linkcheck
Aug 27, 2026
Merged

ci: harden the link check so it fails only on real breakage#7
adamXbot merged 1 commit into
mainfrom
ci/harden-linkcheck

Conversation

@adamXbot

Copy link
Copy Markdown
Collaborator

Follow-up to the --base . repair, with everything verified against lychee 0.24.2 locally before pushing this time. All four repos report 0 errors with these exact arguments.

What was still wrong

Problem Effect Verified how
--accept replaces the default accept set 201/202/204/207/226 counted as broken links httpbin: 204 passes by default, rejected under --accept 200,206,429
lychee exits non-zero on a timeout a run reporting Errors 0 still failed the PR lone timeout exits 2; with --accept-timeouts exits 0, and a 404 still exits 2
transient 429/5xx cached for 24h one blip poisons later runs; re-running does not clear it --cache-exclude-status '429,500..=599'
path filters omitted the workflow this is how --base . shipped and survived three weekly crons — a PR editing only the link check did not run it filters now include .github/workflows/linkcheck.yml
issue step gated on failure() a checkout or npm run check failure filed an issue titled "Broken links found", with an empty body now gated on lychee's own exit_code, and reuses one issue instead of filing a fresh one every cron
package.json still shipped lychee --base . anyone running npm run linkcheck hit the exact error that broke CI for 16 days the workflow was fixed last pass; the script was not

Also --max-concurrency 32 rather than 128 requests from one runner IP, and the four workflows are now generated from one template so they are genuinely identical apart from their excludes.

Every exclude carries its reason inline. docs.*.privacykey.org is marked to be dropped once DNS exists — those links are dead for readers, not just for CI.

Follow-up to the --base . repair. Verified against lychee 0.24.2 locally before
pushing this time; all four repos report 0 errors with these exact arguments.

- --accept REPLACES lychee's default accept set rather than extending it, so the
  inherited '--accept 200,206,429' silently made 201/202/204/207/226 count as
  broken links. Proven with httpbin: a 204 passes by default and is rejected
  under the old flag. Now restates the default set plus 429.
- --accept-timeouts is the purpose-built flag for "fail on broken, tolerate
  slow". lychee counts a TIMEOUT as an error and exits 2, which is how a run
  reporting "Errors 0" failed a PR on a slow tauri.app. Confirmed: a lone
  timeout now exits 0, a 404 still exits 2.
- --cache-exclude-status stops a transient 429/5xx being cached as a failure and
  replayed for 24h, which re-running the job does not clear.
- --max-concurrency 32 instead of the default 128 from a single runner IP.
- The path filters now include the workflow itself. Omitting it is why --base .
  shipped and survived three weekly crons: a PR editing only the link check did
  not run the link check.
- The issue step is gated on lychee's own exit code, not on the job failing, so
  a checkout or 'npm run check' failure can no longer file an issue titled
  "Broken links found". It also reuses one issue instead of filing a fresh one
  every failing cron.
- package.json still shipped the broken 'lychee --base .' in the linkcheck
  script; the workflow was fixed in the last pass and the script was not.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adamXbot
adamXbot merged commit 58394f8 into main Aug 27, 2026
1 check passed
@adamXbot
adamXbot deleted the ci/harden-linkcheck branch August 27, 2026 14:38
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.

1 participant