Skip to content

Scope write permissions to job in update_python_dependencies.yml - #41516

Merged
derrickaw merged 1 commit into
masterfrom
codescan/gha-update-python-deps-permissions
Nov 23, 2026
Merged

derrickaw merged 1 commit into
masterfrom
codescan/gha-update-python-deps-permissions

Conversation

@derrickaw

@derrickaw derrickaw commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • The PR remediates confirmed, live Code Scanning finding(s) (CodeQL / zizmor) on master without altering intended public API or workflow semantics
  • The fix is minimal, idiomatic, and avoids suppressing alerts or masking underlying defects
  • Relevant unit tests, linters, and CI checks have been verified

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 5 open zizmor findings 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) so set-properties runs with minimal privileges, and scopes contents: write and pull-requests: write exclusively to the update_python_dependencies job.
    • 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

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot added build size/s S: 10-49 lines changed labels Nov 20, 2026
@derrickaw derrickaw added ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review and removed ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review labels Nov 20, 2026
@derrickaw
derrickaw marked this pull request as ready for review November 21, 2026 02:35
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label build.
Backup reviewer: Amar3tto (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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: write and pull-requests: write) accurately match the privileges required by actions/checkout, git push, and gh pr create --label, while ensuring the set-properties job 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 damccorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@derrickaw

Copy link
Copy Markdown
Collaborator Author

Ran a sample workflow_dispatch job off codescan/gha-update-python-deps-permissions:

Also running sample workflow_dispatch verification across the other open workflow/action PRs (#41499, #41526, #41515) and adding sample run links to all future workflow PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants