Port upstream changes from bazel-contrib/setup-bazel v0.9.0 to v0.19.0#30
Port upstream changes from bazel-contrib/setup-bazel v0.9.0 to v0.19.0#30
Conversation
Port behavioral improvements from upstream while preserving the Blacksmith sticky disk integration and CommonJS module system. New action inputs: - cache-save: disable cache saving (e.g. on PRs) - module-root: support monorepo layouts - output-base: configurable Bazel output base Key changes: - Add arch to cache key for multi-arch correctness - Parse repository-cache as YAML for list support - Use common scope for repository_cache bazelrc flag - Prefix file patterns with module-root for monorepo support - Use RUNNER_TEMP for Google credentials temp dir - Include repository cache files in disk cache key - Export BAZELISK_GITHUB_TOKEN for Bazelisk downloads - Improve restoreCache with try/catch/finally error handling - Parallelize external cache manifest restores - Add Windows .exe extension for cached bazel binary - Gate external cache saving on cache-save input - Add post-if to ensure cleanup runs on cancellation - Derive Windows disk/repo paths from output-base - Bump version to 0.19.0, Node to 24.14.0, checkout to v6 Co-authored-by: Codesmith <codesmith@blacksmith.sh>
Co-authored-by: Codesmith <codesmith@blacksmith.sh>
The dist bundles were rebuilt locally without the Buf registry packages (which require BUF_TOKEN auth), causing @connectrpc/connect to be replaced with @@NotFound stubs that crash at runtime. Reverts dist/ to the last known working state and changes CI to: - Auto-commit rebuilt dist instead of failing on differences - Check out the actual branch head (not merge commit) so push works - Run setup-bazel matrix jobs after test to use fresh dist - Pass ref to setup-bazel checkout so it picks up auto-committed dist Co-authored-by: Codesmith <codesmith@blacksmith.sh>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| using: node24 | ||
| main: dist/main/index.js | ||
| post: dist/post/index.js | ||
| post-if: "!cancelled()" |
There was a problem hiding this comment.
post-if prevents cleanup on job cancellation
Medium Severity
Adding post-if: "!cancelled()" actually prevents the post script from running on job cancellation. The default behavior (no post-if) is equivalent to always(), which runs on success, failure, and cancellation. The new !cancelled() condition excludes cancellation, meaning cleanupStickyDisks() in post.js won't execute when a job is cancelled. This contradicts the PR description's claim that "sticky disk cleanup always runs regardless" and could lead to leaked sticky disk resources on cancelled jobs.


This PR ports all behavioral improvements from upstream
bazel-contrib/setup-bazel(v0.9.0 through v0.19.0) into the fork while preserving the Blacksmith sticky disk integration and CommonJS module system. The upstream migrated to ESM, so this is a manual port of the logic changes rather than a git merge.How it works:
cache-save(gate cache saving, useful for PRs),module-root(monorepo support by prefixing all file patterns), andoutput-base(configurable Bazel output base with smart Windows C:/D: detection)config.jsnow addsarchto cache keys for multi-arch correctness, parsesrepository-cacheas YAML (enabling list syntax), usescommonscope forrepository_cachebazelrc flag, derives Windows disk/repo paths fromoutput-base, usesRUNNER_TEMPfor Google credentials, includes repository cache files in the disk cache key, and exportsBAZELISK_GITHUB_TOKENfor authenticated Bazelisk downloadsindex.jsreplaces thesetTimeout(delay, callback)pattern inrestoreCachewith properawait setTimeout(delay)+try/catch/finallyfor error resilience, parallelizes external cache manifest restores withPromise.all, reads the GitHub token fromBAZELISK_GITHUB_TOKENenv var, and adds Windows.exeextension when caching the bazel binarypost.jsgates external cache saving behindconfig.cacheSave(sticky disk cleanup always runs regardless)action.ymladdspost-if: "!cancelled()"so cleanup runs even on job cancellationThe dependency versions stay on their current CJS-compatible majors (
@actions/corev1,@actions/githubv6, etc.) since the upstream bumped to ESM-only major versions that would break the@connectrpc/@bufgRPC packages. The behavioral changes we're porting don't depend on those API changes. Thedist/bundles will need rebuilding in CI — the source changes are committed here, and CI will flag if the dist is stale.