feat: onboarding setup-bazel action#1
Conversation
|
|
||
| for (const name in externalCacheConfig.manifest) { | ||
| externalCache[name] = { | ||
| enabled: externalCacheConfig.manifest[name] != false, |
There was a problem hiding this comment.
Use strict equality (!==) instead of loose equality (!=)
Loose equality can cause unexpected type coercion. Use strict equality to match the pattern used elsewhere in this file (e.g., repositoryCacheConfig !== false).
| enabled: externalCacheConfig.manifest[name] != false, | |
| enabled: externalCacheConfig.manifest[name] !== false, |
| - uses: actions/checkout@v7 | ||
| - uses: ./ | ||
| - if: failure() && runner.debug == '1' | ||
| uses: mxschmitt/action-tmate@v3 |
There was a problem hiding this comment.
Third-party action not pinned to a commit SHA
mxschmitt/action-tmate is not an official GitHub action and is pinned only to a mutable tag (v3), not to a specific commit SHA. A compromised tag could lead to arbitrary code execution in your runners. Pin to a full SHA:
| uses: mxschmitt/action-tmate@v3 | |
| uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730827f1602a3 # v3 |
(Verify the SHA against the upstream repo before merging.)
| os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu"]') || fromJSON('["ubuntu", "macos", "windows"]') }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 |
There was a problem hiding this comment.
actions/checkout@v7 is not pinned to a commit SHA
Pin to a specific commit SHA to protect against supply-chain attacks via a mutable tag.
| - uses: actions/checkout@v7 | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
(Verify the SHA; also note that the latest stable release is v4, not v7.)
PR ReviewAction TypeNode-based — uses ✅ Passed Checks
❌ Failed Checks
|
subscription checks added and other changes subscription checks added and other changes
48eb941 to
146648c
Compare
| const fileContent = fs.readFileSync(filePath) | ||
| const actualHash = crypto.createHash('sha256').update(fileContent).digest('hex') | ||
| if (actualHash !== expectedHash) { | ||
| core.warning(`Checksum mismatch for Bazelisk. Expected ${expectedHash}, got ${actualHash}`) |
There was a problem hiding this comment.
Security: checksum mismatch should fail, not warn.
core.warning() here logs a message but allows execution to continue — a tampered Bazelisk binary will still be installed and run on the runner.
| core.warning(`Checksum mismatch for Bazelisk. Expected ${expectedHash}, got ${actualHash}`) | |
| throw new Error(`Checksum mismatch for Bazelisk. Expected ${expectedHash}, got ${actualHash}`) |
This should be a hard failure to prevent supply-chain attacks via a modified binary.
| os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu"]') || fromJSON('["ubuntu", "macos", "windows"]') }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 |
There was a problem hiding this comment.
actions/checkout@v7 does not exist.
The latest stable release is v4. This will cause the CI workflow to fail with a resolution error.
| - uses: actions/checkout@v7 | |
| - uses: actions/checkout@v4 |
| // with Bazel 6.3 and onwards, common accepts any legal Bazel option | ||
| // https://github.com/bazelbuild/bazel/issues/3054 | ||
| bazelrc.push(`build --disk_cache=${bazelDisk}`) | ||
| if (diskCacheName !== 'true') { |
There was a problem hiding this comment.
Logic bug: condition is always true.
diskCacheName is hardcoded to 'disk' two lines above, so diskCacheName !== 'true' is always true. The intended guard is against the user setting disk-cache: true (i.e. the raw input), to avoid producing a cache key like disk-true.
| if (diskCacheName !== 'true') { | |
| if (diskCacheConfig !== 'true') { |
PR ReviewAction TypeNode-based action (runtime: ✅ Passed Checks
❌ Failed Checks
|
No description provided.