Repository navigation
fix(ci): authenticate Bun release downloads in the CLI build - #492
Merged
Merged
Conversation
This was referenced Nov 14, 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
publish.ymlfailed twice inbuild-cli→Build Bun CLI packages(run 43519568020, attempts 1 and 2):
Failed to download bun-windows-x64-baseline from Bun release bun-v1.4.4: 403Failed to resolve Bun release bun-v1.4.4: 403packages/cli/script/build.tsreads Bun release metadata fromapi.github.comand downloadseach asset from
api.github.com, addingAuthorization: Beareronly whenGH_TOKENorGITHUB_TOKENis present. That step'senv:set onlyBUN_COMPILE_RELEASEand theOPENCODE_*values, so every request went out anonymous against the 60 requests/hour per-IP limit, which is
shared with everything else running on that hosted runner's IP. A full release build makes one
metadata call plus two downloads (archive +
SHASUMS256.txt) for each of the 12 targets, about25 API requests, so a build can lose the race for the remaining anonymous budget at any point.
Fix
Add
GH_TOKEN: ${{ github.token }}to theBuild Bun CLI packagesstep env, the same expressionthe
Create GitHub releasestep in this file already uses. An authenticated token moves thosecalls to the authenticated
GITHUB_TOKENlimit (1,000/hour per repository); reading a public release needs no special scope, andthe job already inherits
contents: write.packages/cli/script/build.tsalready supports this, so the script is unchanged.Scope
.github/workflows/publish.ymlis the only workflow that setsBUN_COMPILE_RELEASE, so it isthe only step that contacts
api.github.com.test.yml'sbun run script/build.ts --single --skip-installdoes not setBUN_COMPILE_RELEASE,so it compiles with a single target and never reaches those API calls. Left untouched.
Validation
git diff --checkclean.publish.ymlparses via bothyaml.parse(Bun) andyaml.safe_load(Python); the step envresolves to
GH_TOKEN+ the existing four entries.actionlintparses the file (only the pre-existing SC2193 shellcheck warnings at lines 157/168).prettier --check .github/workflows/publish.ymlpasses.No feature flag: this only repairs an existing CI step's credentials, with no user-visible
behavior change.