Repository navigation
Scope GITHUB_TOKEN permissions across remaining workflows - #41671
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR properly scopes GITHUB_TOKEN permissions across 12 GitHub Actions workflows following the principle of least privilege. Read-only workflows are restricted to contents: read at the workflow level, and elevated permissions (actions: read for artifact downloads in build_release_candidate.yml and contents: write for tag/release creation in git_tag_released_version.yml and publish_github_release_notes.yml) are accurately scoped to the specific jobs that require them.
🔍 General Feedback
- All workflow and job-level permission declarations match the actual token usage across steps, composite actions, and helper scripts.
- No functional issues or regressions identified.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @Amar3tto 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). |
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 semanticsworkflow_dispatchruns (for workflow/action changes) have been verifiedInitiative Progress (as of
2026-11-25 15:26 UTC):16PRs merged so far, with~21more PRs needed to be merged to close out all actionable Code Scanning findings (with#41637disablingNote-levelzizmor/self-repositorywarnings).Code Scanning Remediation Context (End Goal, Scope & Impact)
apache/beam's actionableHighandMediumCode Scanning backlog (CodeQL+zizmor) down to zero.Note-levelzizmor/self-repositorywarnings (~89% of all open alerts) are handled via.github/zizmor.ymlconfig (Disable zizmor self-repository rule in .github/zizmor.yml #41637) rather than churning ~300 workflow files.ZipSlip) fixes in JavaZipFiles.unzipFile(Enforce canonical path prefix check in ZipFiles.unzipFile #41497) and Go xlangexpansionx(Enforce IsLocal and prefix check in expansionx validatePath #41589)High) fixes in shared CI composite actions (Pass inputs via env in build-push-docker-action #41515, Pass inputs and outputs via env in test-arguments-action #41592, Pass inputs and outputs via env in setup-k8s-access #41605) andpr-bot(Pass git argument arrays to @actions/exec in pr-bot updateReviewers #41524)GITHUB_TOKENscoping across CI and release workflows (Harden permissions and setup-node caching in typescript_tests.yml #41499, Scope write permissions to job in update_python_dependencies.yml #41516, Scope write permissions to jobs in cut_release_branch.yml #41522, Add read-only permissions and self-repo actions in python_tests.yml #41526, Add read-only permissions and self-repo actions in java_tests.yml #41626, Add read-only permissions and self-repo actions in local_env_tests.yml #41631) and dead-code removal (Remove unused dind-up-action composite action #41585)If 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
Resolves all 51 remaining permission-only GitHub Code Scanning alerts (
actions/missing-workflow-permissions(CodeQL) andzizmor/excessive-permissions) across 12 workflow files in.github/workflows/:permissions: contents: readat workflow level):.github/workflows/build_runner_image.yml(2 alerts: #3, #1460).github/workflows/build_wheels.yml(15 alerts: #5, #10, #12, #14, #16, #20, #22, #1464–#1467, #1469, #1471, #1900, #1901;branch_repo_nightlyalready declares job-levelcontents: write).github/workflows/playground_frontend_test.yml(2 alerts: #27, #1583).github/workflows/refresh_looker_metrics.yml(2 alerts: #97, #1799).github/workflows/reportGenerator.yml(2 alerts: #96, #1800).github/workflows/republish_released_docker_containers.yml(5 alerts: #3531–#3533, #3535, #3536).github/workflows/tour_of_beam_backend.yml(2 alerts: #36, #1739).github/workflows/tour_of_beam_backend_integration.yml(2 alerts: #39, #1745).github/workflows/tour_of_beam_frontend_test.yml(2 alerts: #37, #1748).github/workflows/build_release_candidate.yml(15 alerts: #4, #6, #8, #9, #11, #18, #21, #1387, #1394, #1788–#1792, #3514): sets top-levelpermissions: contents: readand grantsactions: readspecifically tostage_python_artifacts(required bydownload_github_actions_artifacts.pyto download wheel/sdist workflow artifacts via the GitHub Actions REST API; PR/release-upload jobs useinputs.REPO_TOKEN)..github/workflows/git_tag_released_version.yml(1 alert: #1550): sets top-levelpermissions: {}and scopescontents: writetogenerate_tags..github/workflows/publish_github_release_notes.yml(1 alert: #1600): replacespermissions: read-allwith top-levelpermissions: contents: readand scopescontents: writetopublish_github_release_notes(which callsPOST /repos/apache/beam/releaseswithGITHUB_TOKEN).Verification
zizmor --config .github/zizmor.ymlacross all 12 modified workflows (0findings)./gradlew :beam-test-gha:preCommit(BUILD SUCCESSFUL)Tour of Beam Go integration tests(pull_request): https://github.com/apache/beam/actions/runs/45641824215 (SUCCESS)Tour of Beam Go unittests(workflow_dispatch): https://github.com/apache/beam/actions/runs/45641823606 (SUCCESS)Build and Version Runner Docker Image(workflow_dispatch, non-push dry build): https://github.com/apache/beam/actions/runs/45641828599 (SUCCESS)dev@beam.apache.org.