fix(cache): disable setup-bun cache to avoid 5-retry HTML-error burn#1259
fix(cache): disable setup-bun cache to avoid 5-retry HTML-error burn#1259MukundaKatta wants to merge 1 commit intoanthropics:mainfrom
Conversation
The upstream oven-sh/setup-bun action saves with a deterministic key (Bun version) that isn't ref-aware. On every second-and-subsequent run against the same PR ref, the GitHub cache API rejects the duplicate key+ref with a 409 (HTML body), and @actions/cache treats the unparsable response as transient and burns ~20-30s on 5 retries before warning. The 35 MB Bun binary downloads in 2-3s, so disabling the cache is a net wallclock win and removes the noisy warning that fires on every PR push after the first. Closes anthropics#1252
ndrc81
left a comment
There was a problem hiding this comment.
Approving this fix from a downstream-user perspective. We use claude-code-action@v1 in two workflows on a private repo (Claude Code Review and Adversarial Security Review), running on every PR per project policy. Each PR push burns approximately 5 minutes on the setup-bun post-step retries described in #1252, plus warning noise that masks real cache issues. At our current PR volume that pushes us to roughly 95% of the GitHub Team plan's 3000 min/month included allowance, with the burn entirely attributable to this bug.
The action-side fix here (no-cache: true on oven-sh/setup-bun) is the minimum-surface change and avoids the larger refactor of patching setup-bun upstream or migrating to a curl-based install. The 35 MB Bun binary downloads in 2-3s on GitHub-hosted runners, so the disabled-cache wallclock is a clear net win against the 20-30s of failing-retry burn on the current path. Confirming the YAML change is contained to the two action.yml files and does not change any TypeScript logic.
No additional regression risk we can identify. Strongly support merge.
Why
Closes #1252.
anthropics/claude-code-action@v1's post-job cache save fails consistently on every second-and-subsequent run against the same PR ref. From the issue:Root cause:
oven-sh/setup-bun@v2.2.0's post step calls@actions/cache.saveCachewith a deterministic key derived from the Bun download URL (bun-<hash>). The key is identical across runs, so on every PR re-push the GitHub cache API rejects the duplicate key+ref with a 409 (HTML body).@actions/cache@5.xtreats the unparsable response as transient and burns ~20-30s on 5 retries before surfacing a warning. The cache key isn't ref-aware andsetup-bundoesn't expose a way to override it, so the issue is unavoidable as long as the cache is enabled.This burns ~20-30s of wallclock per PR push after the first, plus persistent warning noise that masks real cache issues. See #1252 for the full repro and cache-entry inspection.
What
Pass
no-cache: truetooven-sh/setup-bunin bothaction.ymlandbase-action/action.yml. The 35 MB Bun binary downloads frombun.shin 2-3s on GitHub-hosted runners (curl install also relies on this in PR #819), so disabling the cache is a net wallclock win and removes the warning entirely.This is the smallest action-side fix — alternatives would require either patching
setup-bunupstream (issue author's option 2) or replacing it with curl-based install (issue author's option 4 / open PR #819, which targets a separate GHES bug).Tested
Manual verification only — the change is YAML-only inside the composite step, and there are no unit tests for
action.ymlintest/(tests cover TypeScript logic).To verify after merge, run the action twice on the same PR ref and confirm:
Downloading a new version of Bunon every run instead ofUsing a cached version of Bun.