Repository navigation
Scope write permissions to job in update_python_dependencies.yml - #41516
Conversation
|
/gemini review |
|
Assigning reviewers: R: @damccorm 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). |
There was a problem hiding this comment.
📋 Review Summary
This PR cleanly hardens .github/workflows/update_python_dependencies.yml by restricting workflow-level permissions to contents: read and scoping contents: write and pull-requests: write specifically to the update_python_dependencies job. It also updates local composite action invocations to use GitHub's self-repository ($/) syntax to resolve zizmor findings.
🔍 General Feedback
- The scoped job permissions (
contents: writeandpull-requests: write) accurately match the privileges required byactions/checkout,git push, andgh pr create --label, while ensuring theset-propertiesjob runs with read-only permissions. - Replacing
./.github/actions/...with$/.github/actions/...is safe here since the workflow operates directly on the checked-out commit without modifying local action definitions at runtime.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
damccorm
left a comment
There was a problem hiding this comment.
Thanks! Could you run a sample job off of this branch (and link to it/the PR it produces)? If you have other auto-generated changes like this, it would be good to do that for all of them.
|
Ran a sample
Also running 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
zizmorfindings in.github/workflows/update_python_dependencies.yml:zizmor/excessive-permissions(High / error, alerts#1775,#3486): restricts top-level workflow permissions to read-only (contents: read) soset-propertiesruns with minimal privileges, and scopescontents: writeandpull-requests: writeexclusively to theupdate_python_dependenciesjob.zizmor/self-repository(Note, alerts#3481,#3154,#3155): updates local composite action references from./.github/actions/...to GitHub's self-repository$/syntax ($/.github/actions/...).Verification
./gradlew :beam-test-gha:preCommitworkflow_dispatchrun on branchcodescan/gha-update-python-deps-permissions: https://github.com/apache/beam/actions/runs/45211001674 — succeeded end-to-end and opened sample PR Update Python Dependencies #41588 (subsequently closed after verification)