Skip to content

fix(ci): authenticate Bun release downloads in the CLI build - #492

Merged
shuv1337 merged 1 commit into
integration-v2from
buildcli-gh-token
Nov 14, 2026
Merged

shuv1337 merged 1 commit into
integration-v2from
buildcli-gh-token

Conversation

@shuv1337

@shuv1337 shuv1337 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Problem

publish.yml failed twice in build-cli → Build Bun CLI packages
(run 43519568020, attempts 1 and 2):

  • attempt 1: Failed to download bun-windows-x64-baseline from Bun release bun-v1.4.4: 403
  • attempt 2: Failed to resolve Bun release bun-v1.4.4: 403

packages/cli/script/build.ts reads Bun release metadata from api.github.com and downloads
each asset from api.github.com, adding Authorization: Bearer only when GH_TOKEN or
GITHUB_TOKEN is present. That step's env: set only BUN_COMPILE_RELEASE and the OPENCODE_*
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, about
25 API requests, so a build can lose the race for the remaining anonymous budget at any point.

Fix

Add GH_TOKEN: ${{ github.token }} to the Build Bun CLI packages step env, the same expression
the Create GitHub release step in this file already uses. An authenticated token moves those
calls to the authenticated GITHUB_TOKEN limit (1,000/hour per repository); reading a public release needs no special scope, and
the job already inherits contents: write.

packages/cli/script/build.ts already supports this, so the script is unchanged.

Scope

  • .github/workflows/publish.yml is the only workflow that sets BUN_COMPILE_RELEASE, so it is
    the only step that contacts api.github.com.
  • test.yml's bun run script/build.ts --single --skip-install does not set BUN_COMPILE_RELEASE,
    so it compiles with a single target and never reaches those API calls. Left untouched.

Validation

  • git diff --check clean.
  • publish.yml parses via both yaml.parse (Bun) and yaml.safe_load (Python); the step env
    resolves to GH_TOKEN + the existing four entries.
  • actionlint parses the file (only the pre-existing SC2193 shellcheck warnings at lines 157/168).
  • prettier --check .github/workflows/publish.yml passes.

No feature flag: this only repairs an existing CI step's credentials, with no user-visible
behavior change.

@shuv1337 shuv1337 added the full-tests Run the full test suite (unit and e2e) on this PR label Nov 14, 2026
@shuv1337
shuv1337 merged commit b8986cf into integration-v2 Nov 14, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-tests Run the full test suite (unit and e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant