Skip to content

fix: scope publish-preview write permission to the calling job - #11091

Merged
georgewrmarshall merged 1 commit into
mainfrom
cursor/scope-preview-permissions-3abf
Oct 26, 2026
Merged

georgewrmarshall merged 1 commit into
mainfrom
cursor/scope-preview-permissions-3abf

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

@metamaskbot publish-preview calls the shared MetaMask/github-tools preview workflow. That workflow checks out the repository and comments on the pull request, so the caller has to grant contents: read and pull-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: write as overly broad (code scanning alert 206). A job-level permissions block replaces the workflow set rather than adding to it, so this keeps contents: read on the workflow and on the publish-preview job, and moves pull-requests: write onto 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: write on the workflow. This applies that permissions fix to the core caller.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
Open in Web Open in Cursor 

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.

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
georgewrmarshall requested a review from a team as a code owner October 26, 2026 17:47
Comment thread .github/workflows/publish-preview.yml Resolved
@georgewrmarshall
georgewrmarshall marked this pull request as draft October 26, 2026 17:56
@georgewrmarshall georgewrmarshall self-assigned this Oct 26, 2026
@georgewrmarshall
georgewrmarshall marked this pull request as ready for review October 26, 2026 18:22

@mcmire mcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Weird, didn't know this. Thanks for making this change!

@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit ecf95e1 Oct 26, 2026
424 of 431 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/scope-preview-permissions-3abf branch October 26, 2026 20:13

This branch was previously deployed

1 inactive deployment
default-branch — 7c4a5b1e Deployed Oct 26, 2026 by georgewrmarshall via Determine whether this PR is a release PR #6052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants