Skip to content

ci(link-check): use lychee --base-url and authenticate github.com - #172

Merged
Arthurvdv merged 1 commit into
mainfrom
worktree-ci+lychee-base-url-and-token
Sep 5, 2026
Merged

ci(link-check): use lychee --base-url and authenticate github.com#172
Arthurvdv merged 1 commit into
mainfrom
worktree-ci+lychee-base-url-and-token

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

What

Fixes two warnings emitted by the scheduled External link check (lychee) job — not the Hugo build, which is already correct.

  1. --base is deprecated → renamed to --base-url in the lychee step (the old flag "will soon be removed").
  2. Host github.com sent an unexpectedly big rate limit backoff duration of 5m. Capping the duration to 1m instead. → lychee was crawling the site's 27 github.com links unauthenticated, tripping GitHub's 60 req/hr limit. Passing token: ${{ secrets.GITHUB_TOKEN }} authenticates those requests (5000 req/hr), removing the backoff.

Doc comments in link-check.yaml and .lycheeignore updated to match the new flag name.

Verification

The job runs on schedule + workflow_dispatch. After merge (or on this branch), trigger it manually:

gh workflow run "External link check" --ref <branch>

and confirm the log no longer shows the --base is deprecated or rate limit backoff warnings, and the job still reports link results.

Reference (failing) run: https://github.com/ALCops/alcops.dev/actions/runs/33973902514/job/101327250177

🤖 Generated with Claude Code

lychee deprecated --base in favor of --base-url; the old flag will be
removed. Pass a GITHUB_TOKEN to the lychee step so github.com links are
checked authenticated (5000 req/hr instead of 60), removing the repeated
"unexpectedly big rate limit backoff ... Capping to 1m" warnings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit 5abaf21 into main Sep 5, 2026
1 check passed
@Arthurvdv
Arthurvdv deleted the worktree-ci+lychee-base-url-and-token branch September 5, 2026 15:24
Arthurvdv added a commit that referenced this pull request Sep 5, 2026
…#173)

The scheduled External link check still logged, even after #172 added a
GITHUB_TOKEN:

  Host github.com sent an unexpectedly big rate limit backoff duration of 5m.
  Capping the duration to 1m instead.

The warning comes from lychee's per-host adaptive rate limiter: when github.com
rate-limits us it returns a multi-minute reset, which exceeds lychee's hardcoded
60s cap. The token only raises the REST API limit; plain github.com web-page
checks (/blob/, /tree/, /releases, anchors) don't use the API, so a burst of
concurrent requests still trips github.com's rate limit.

Add .github/lychee.toml throttling only github.com (concurrency 2, 1s interval)
and pass --config to it. lychee-action@v2 ships lychee v0.24.2, which supports
per-host config (v0.23.0+). Other hosts are unaffected; ~30s added to a weekly
job that already has fail: false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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