Skip to content

fix(ci): authenticate Link Check to github.com to stop rate-limit false-positives (#316) - #317

Merged
mogul merged 2 commits into
mainfrom
fix/link-check-github-token-316
Aug 12, 2026
Merged

fix(ci): authenticate Link Check to github.com to stop rate-limit false-positives (#316)#317
mogul merged 2 commits into
mainfrom
fix/link-check-github-token-316

Conversation

@wz-gsa

@wz-gsa wz-gsa commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #316. The Link Check job (tcort/github-action-markdown-link-check, unauthenticated) intermittently reports live github.com URLs as dead (Status: 0/503) when a run checks many links at once and hits GitHub's ~60/hr anonymous rate limit — observed blocking approved PRs #313 and #315 on consecutive runs; every flagged link is 200 in a browser. retryOn429 never engaged because GitHub sheds anonymous load with 503, not 429.

Fix (no new secret — read-only token only)

  • httpHeaders: send Authorization: Bearer <token> for github.com / api.github.com / raw.githubusercontent.com so those links are checked authenticated (5000/hr). A CI step renders the read-only workflow GITHUB_TOKEN into the placeholder with envsubst (whitelisted to ${MLC_GITHUB_TOKEN} only) → a git-ignored .markdown-link-check.ci.json. Locally the placeholder stays inert (Bearer ), so the committed config carries no token and github answers anonymously.
  • aliveStatusCodes: add 429 + 503 so a throttled probe of a live host defers instead of being reported dead (belt-and-suspenders).
  • retryCount 3 → 5.

Real dead links still fail (a genuine 404 isn't in aliveStatusCodes). Job stays continue-on-error.

Verification

Config renders to valid JSON with + without a token; envsubst only touches the whitelisted placeholder; make validate + 354 tests pass; gettext-base/envsubst is preinstalled on ubuntu runners.

Impact

Stops the recurring re-run tax on every PR that touches many github.com links (retires the workaround applied on #313/#315). Read-only github.token, no elevated permission.

Rollback

Revert. CI config + link-check config only; no repo content change.

AI-assisted (OpenCode). Requires human review.

…se-positives (#316)

The Link Check job (tcort/github-action-markdown-link-check, unauthenticated)
intermittently reported LIVE github.com URLs as dead (Status 0/503) when a run
checked many links at once and hit GitHub's ~60/hr anonymous rate limit — seen
blocking approved PRs #313/#315 on consecutive runs, every flagged link 200 in
a browser. retryOn429 never engaged because GitHub sheds anonymous load with
503, not 429.

Fix (no new secret, read-only token only):
- httpHeaders: send Authorization: Bearer <token> for github.com / api.github.com
  / raw.githubusercontent.com, so those links are checked AUTHENTICATED
  (5000/hr). A CI step renders the read-only workflow GITHUB_TOKEN into the
  placeholder via envsubst (whitelisted to  only) → a
  git-ignored .markdown-link-check.ci.json; locally the placeholder stays inert
  ('Bearer '), so github still answers anonymously and the committed config
  carries no token.
- aliveStatusCodes: add 429 + 503 so a throttled probe of a live host defers
  instead of being reported dead (belt-and-suspenders alongside the token).
- retryCount 3 -> 5.

Real dead links still fail (a genuine 404 is not in aliveStatusCodes). Job stays
continue-on-error. Verified: config renders to valid JSON with + without a token;
make validate + 354 tests pass.

Closes #316.

AI-assisted (OpenCode). Requires human review.

Co-authored-by: OpenCode Agent <william.zujkowski@gsa.gov>
@wz-gsa
wz-gsa requested a review from a team as a code owner August 12, 2026 18:00
Follow-up within #316: with github.com now authenticated, the only remaining
Link Check false-positive was nvd.nist.gov -> Status 0. NVD is bot-hostile to the
checker's unauthenticated HEAD probe (same behavior as asciinema.org) but is a
live, stable gov site referenced from the dependency-analysis skill. Ignore it,
matching the asciinema treatment. Real dead links still fail.

Co-authored-by: OpenCode Agent <william.zujkowski@gsa.gov>
@mogul
mogul merged commit e71209f into main Aug 12, 2026
8 checks passed
@mogul
mogul deleted the fix/link-check-github-token-316 branch August 12, 2026 19:22
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.

Link Check flaky under GitHub rate-limiting (live URLs reported dead on many-link runs)

2 participants