Repository navigation
fix: scope publish-preview write permission to the calling job - #11091
Merged
Merged
Conversation
zizmor flags workflow-level pull-requests: write as overly broad. Grant it only on the publish-preview job, and keep contents: read on the workflow and the job. Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
georgewrmarshall
temporarily deployed
to
default-branch
October 26, 2026 17:47 — with
GitHub Actions
Inactive
georgewrmarshall
marked this pull request as draft
October 26, 2026 17:56
georgewrmarshall
marked this pull request as ready for review
October 26, 2026 18:22
georgewrmarshall
temporarily deployed
to
default-branch
October 26, 2026 18:22 — with
GitHub Actions
Inactive
georgewrmarshall
enabled auto-merge
October 26, 2026 18:22
mcmire
approved these changes
Oct 26, 2026
mcmire
left a comment
Collaborator
There was a problem hiding this comment.
Weird, didn't know this. Thanks for making this change!
georgewrmarshall
disabled auto-merge
October 26, 2026 19:08
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 26, 2026
This branch was previously deployed
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.
Explanation
@metamaskbot publish-previewcalls the sharedMetaMask/github-toolspreview workflow. That workflow checks out the repository and comments on the pull request, so the caller has to grantcontents: readandpull-requests: write. The org token is read-only by default, which is why #8235 added both permissions on this workflow.zizmor reports workflow-level
pull-requests: writeas overly broad (code scanning alert 206). A job-levelpermissionsblock replaces the workflow set rather than adding to it, so this keepscontents: readon the workflow and on thepublish-previewjob, and movespull-requests: writeonto that job only. The shared workflow is unchanged.The same finding showed up on MetaMask/metamask-design-system#1620. That change adopted this shared caller to fix a preview-token code scanning alert, and zizmor then flagged
pull-requests: writeon the workflow. This applies that permissions fix to the core caller.References
Checklist
Note
Low Risk
CI permission scoping only; no application or secrets logic changes, with the same effective permissions on the job that runs the preview workflow.
Reviewed by Cursor Bugbot for commit 7c4a5b1. Bugbot is set up for automated code reviews on this repo. Configure here.