Skip to content

fix(INFRA-3359): restrict cherry-pick auto-approval to MetaMask org members#85

Merged
Qbandev merged 1 commit into
mainfrom
fix/policy-bot-restrict-cherry-pick-to-org-members
Mar 5, 2026
Merged

fix(INFRA-3359): restrict cherry-pick auto-approval to MetaMask org members#85
Qbandev merged 1 commit into
mainfrom
fix/policy-bot-restrict-cherry-pick-to-org-members

Conversation

@Qbandev
Copy link
Copy Markdown
Contributor

@Qbandev Qbandev commented Mar 5, 2026

Problem

cherry-pick auto-approval had no author check. On public repos, an external user could open a fork PR matching the title/branch/LOC criteria and get a success status from policy-bot (status spoofing).

Fix

Add has_author_in: organizations: ["MetaMask"] to the rule's if block. Fork PRs from non-members now fall through to release branch review, which requires MetaMask/release-team approval.

Evaluation logic (unchanged for org members)

Scenario Result
Org member cherry-pick → release/* (<200 LOC) success
Non-member PR → release/* pending (team review required)
Any PR → main success

Jira: INFRA-3359

…embers

Without an author check, any external user could open a fork PR targeting
a release/* branch with "cherry-pick" in the title and fewer than 200 LOC,
causing policy-bot to post a passing status check.

Add `has_author_in: organizations: ["MetaMask"]` to the cherry-pick
auto-approval rule so the auto-approval path is only reachable by members
of the MetaMask GitHub organization.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Qbandev Qbandev merged commit 689a3cc into main Mar 5, 2026
2 checks passed
@Qbandev Qbandev deleted the fix/policy-bot-restrict-cherry-pick-to-org-members branch March 5, 2026 15:25
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.

2 participants