Repository navigation
Harden permissions and setup-node caching in typescript_tests.yml - #41499
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR hardens .github/workflows/typescript_tests.yml by setting explicit top-level contents: read permissions and disabling automatic package manager caching in actions/setup-node@v7 steps. The changes are minimal, safe, and appropriately remediate the CodeQL and zizmor security findings.
🔍 General Feedback
- All jobs in
typescript_tests.ymlonly require read access to repository contents, making top-levelpermissions: contents: readthe right least-privilege setting. - Note (nit):
permissions:was inserted right between the# This allows a subsequently queued workflow run to interrupt previous runscomment andconcurrency:, slightly detaching the comment from theconcurrency:block it describes.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR hardens .github/workflows/typescript_tests.yml by declaring top-level permissions: contents: read and disabling automatic npm caching via package-manager-cache: false across all three actions/setup-node@v7 steps. The previous review comment regarding the placement of permissions: relative to the concurrency: comment has been cleanly resolved.
🔍 General Feedback
- The workflow permissions follow the principle of least privilege, as all four jobs only require read access to check out the repository and run tests.
- Setting
package-manager-cache: falseappropriately mitigateszizmor/cache-poisoningfindings on push/tag triggers without altering test execution semantics.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @Abacn for label build. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
Verified via sample |
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
CodeQL/zizmor) onmasterwithout altering intended public API or workflow semanticsIf you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
CodeQL+zizmor) in.github/workflows/typescript_tests.yml:actions/missing-workflow-permissions(#38,#40,#41,#42) &zizmor/excessive-permissions(#1754,#1755,#1756,#1757,#1758): adds explicit least-privilege top-levelpermissions: contents: readacross all four read-only test jobs.zizmor/cache-poisoning(High / error,#3490,#3491,#3492): setspackage-manager-cache: falseon all threeactions/setup-node@v7steps so default automatic npm cache sharing is disabled on tag/push workflow triggers.Verification
./gradlew :beam-test-gha:preCommitworkflow_dispatchrun on branchcodescan/gha-typescript-tests-hardening: https://github.com/apache/beam/actions/runs/45211008153 (succeeded)