Repository navigation
Add minimum permissions to PR label workflows - #8714
t-will-gillis merged 5 commits into
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
left a comment
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!
|
Thanks @t-will-gillis for checking this. I’ll remove |
|
Hey @Tomlu60220244 would you please finish this PR? if you are no longer working on it, let us know so that we can re-assign it. Thanks |
|
@t-will-gillis Sorry for the delay. I had acknowledged your feedback earlier and intended to remove the unnecessary I have now removed it. I also confirmed that the Action Item boxes in #8592 are checked. Thanks for the reminder, and sorry for leaving this PR unfinished. |
|
@t-will-gillis Sorry for the delay. I had already seen your feedback, but I realized I never pushed the final change. I removed Thanks for the reminder! |
t-will-gillis
left a comment
There was a problem hiding this comment.
Perfect- thanks @Tomlu60220244
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.