Repository navigation
fix(ci): pass GITHUB_TOKEN to the deploy build so star count refreshes - #142
Merged
Merged
Conversation
The GitHub star count in the nav is baked in at build time by
scripts/fetch-github-stars.mjs, run from prebuild. The deploy workflow
has a daily cron, so the number is meant to refresh itself once a day.
It never did: the site shipped 4.7K while apache/iggy was at 5140.
4.7K was the script's hardcoded FALLBACK. Three things combined:
- src/github-stars.json is gitignored, so a fresh CI checkout has no
previous value to fall back to. It is fetch-or-fallback, with no
middle ground.
- The build step was never given a token, so the fetch went out
anonymously against the 60/hr-per-IP limit, which shared Actions
runners exhaust routinely. The API answered 403.
- The script only console.warns on failure, so deploys stayed green
while re-baking the same wrong number every morning.
ci.yml already passed the token, which is why this went unnoticed: the
one workflow wired correctly is the one that does not deploy.
Hand the same secrets.GITHUB_TOKEN already used by the publish step to
the build step in both deploy.yml and stage.yml, lifting the limit to
1000/hr. Also refresh FALLBACK to 5.1K so a failed fetch ships a roughly
correct number rather than a year-stale one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kparisa
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The GitHub star count in the nav is baked in at build time by
scripts/fetch-github-stars.mjs, run fromprebuild.deploy.ymlhas a daily cron, so the number is meant to refresh itself once a day.It never did. The live site shows 4.7K while
apache/iggyis at 5140 (→5.1K).4.7Kis the script's hardcodedFALLBACKconstant — the site has been shipping a placeholder, not a fetched value.Three things combine:
src/github-stars.jsonis gitignored, so a fresh CI checkout has no previous value for the "keep the old value" branch to use. It is fetch-or-fallback, with no middle ground.403.console.warns, so deploys stayed green while re-baking the same wrong number every morning.ci.ymlalready passed the token (line 35), which is why this went unnoticed: the one workflow wired correctly is the one that does not deploy.Fix
Hand the same
secrets.GITHUB_TOKENalready used by the publish step (deploy.yml:41,stage.yml:39) to the build step in both workflows, lifting the limit to 1000/hr:No new secret is required —
GITHUB_TOKENis auto-provisioned by Actions. Neither deploy workflow sets apermissions:block, and the read already succeeds underci.yml's strictercontents: read. The cross-repo read works becauseapache/iggyis public; the auth exists only to move off the anonymous rate-limit bucket.Also refreshes
FALLBACKto5.1Kso a failed fetch ships a roughly correct number rather than a year-stale one.Verification
The CI build log for this PR should show
GitHub stars: 5.1Krather than aGitHub stars: API returned 403warning.Note
The count stays
4.7Kon the live site until this merges and the nextmaindeploy runs; the daily cron keeps it current from then on. The number remains up to ~24h stale by design — that is inherent tooutput: "export", and removing the lag entirely would mean fetching client-side.🤖 Generated with Claude Code