You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "saie-ch (via GitHub)" <gi...@apache.org> on 2026/10/21 13:27:46 UTC
[PR] fix(ci): pass GITHUB_TOKEN to the deploy build so star count refreshes [iggy-website]
saie-ch opened a new pull request, #142:
URL: https://github.com/apache/iggy-website/pull/142
## Problem
The GitHub star count in the nav is baked in at build time by `scripts/fetch-github-stars.mjs`, run from `prebuild`. `deploy.yml` has 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/iggy` is at **5140** (→ `5.1K`). `4.7K` is the script's hardcoded `FALLBACK` constant — the site has been shipping a placeholder, not a fetched value.
Three things combine:
1. **`src/github-stars.json` is 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.
2. **The build step was never given a token.** The fetch went out anonymously against the 60/hr-per-IP limit, which shared Actions runners exhaust routinely → `403`.
3. **The failure is silent** — the script only `console.warn`s, so deploys stayed green while re-baking the same wrong number every morning.
`ci.yml` already 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_TOKEN` already used by the publish step (`deploy.yml:41`, `stage.yml:39`) to the build step in both workflows, lifting the limit to 1000/hr:
```yaml
- name: Build Website
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
No new secret is required — `GITHUB_TOKEN` is auto-provisioned by Actions. Neither deploy workflow sets a `permissions:` block, and the read already succeeds under `ci.yml`'s stricter `contents: read`. The cross-repo read works because `apache/iggy` is public; the auth exists only to move off the anonymous rate-limit bucket.
Also refreshes `FALLBACK` to `5.1K` so a failed fetch ships a roughly correct number rather than a year-stale one.
## Verification
```
$ node scripts/fetch-github-stars.mjs
GitHub stars: 5.1K
```
The CI build log for this PR should show `GitHub stars: 5.1K` rather than a `GitHub stars: API returned 403` warning.
## Note
The count stays `4.7K` on the live site until this merges and the next `main` deploy runs; the daily cron keeps it current from then on. The number remains up to ~24h stale by design — that is inherent to `output: "export"`, and removing the lag entirely would mean fetching client-side.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org