Add minimum permissions to PR label workflows - #8714
Open
Tomlu60220244 wants to merge 4 commits into
Open
Conversation
…sions TEST SETUP: Add workflow permissions for issue 8592
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
t-will-gillis
requested changes
Aug 1, 2026
t-will-gillis
left a comment
Member
There was a problem hiding this comment.
Hey @Tomlu60220244 - Thanks for working on this! We already discussed the reason to add the pull-requests: write permission to wr-set-pr-labels.yaml in #8592. Great catch on this!
The only comments I have are:
- please confirm that the
pull-requests: writepermission is needed onset-pr-labels.yaml. Since the workflow is not writing to the PR in this step it should not be needed. I tested the workflow in my repo, and unless you are seeing something different from me I don't believe this is needed. - very minor thing, but please check the Action Item boxes in the original issue.
Great job again!
Member
Author
|
Thanks @t-will-gillis for checking this. I’ll remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8592
What changes did you make?
Added explicit workflow-level permissions to the PR label workflows.
For
.github/workflows/set-pr-labels.yaml:contents: readissues: readFor
.github/workflows/wr-set-pr-labels.yaml:contents: readactions: readissues: writepull-requests: writeWhy did you make the changes?
This limits the default
GITHUB_TOKENpermissions to the minimum required access for these workflows, following GitHub Actions security best practices.pull-requests: writeis included only in.github/workflows/wr-set-pr-labels.yamlbecause testing confirmed that this workflow needs write access to pull requests. It was removed from.github/workflows/set-pr-labels.yamlbecause that workflow does not write to pull requests.CodeQL Alerts
Screenshots of Proposed Changes To The Website
No visual changes to the website.
Testing
Testing confirmed that
pull-requests: writeis required for.github/workflows/wr-set-pr-labels.yaml, but it is not needed for.github/workflows/set-pr-labels.yaml.With these permissions, each workflow has the minimum permissions needed for its behavior.