Skip to content

Commit 67bf281

Browse files
authored
chore: INFRA-2925:Adding github action to merge stable to main on comment (#23118)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Allows you to merge stable -> main PRs on comment "Merge my PR" **Successful Negative tests:** Not Merging on Incorrect comment: consensys-test#55, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19683528967 Not Merging from wrong source branch: consensys-test#53, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19575100357/job/56058172525 Not Merging into wrong target branch: consensys-test#54, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19575460777/job/56059417843 Not Merging on unapproved PR: consensys-test#55, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19709760888 Not Merging on approver not in Release Team: consensys-test#55, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19709971385 **Desired Successful test:** consensys-test#55, https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/19710071272/job/56467981022 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: None ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Add GitHub Actions workflow to auto-merge PRs on exact "Merge my PR" comment from MEMBER/OWNER using reusable workflow. > > - **CI/GitHub Actions**: > - **New workflow** `/.github/workflows/merge-approved-pr.yml`: > - Triggers on `issue_comment` (created) for PRs. > - Merges when comment is exactly `Merge my PR` and commenter is `MEMBER` or `OWNER`. > - Reuses `MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@30baa9d...`. > - Passes `pr-number` from event and uses `METAMASK_MOBILE_BRANCH_SYNC_TOKEN` as `github-token`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e56215b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 43c756b commit 67bf281

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Merge Approved PR
2+
3+
on:
4+
# Trigger the workflow when a comment is created on an issue or pull request
5+
issue_comment:
6+
types: [created]
7+
8+
jobs:
9+
merge-pr:
10+
# Only run if the comment is on a PR and the comment body matches exactly "Merge my PR"
11+
if: >-
12+
github.event.issue.pull_request &&
13+
github.event.comment.body == 'Merge my PR' &&
14+
(
15+
github.event.comment.author_association == 'MEMBER' ||
16+
github.event.comment.author_association == 'OWNER'
17+
)
18+
uses: MetaMask/github-tools/.github/workflows/merge-approved-pr.yml@30baa9da0b80d94dd8bdf0b6a932c46506664857
19+
with:
20+
pr-number: ${{ github.event.issue.number }}
21+
secrets:
22+
github-token: ${{ secrets.METAMASK_MOBILE_BRANCH_SYNC_TOKEN }}

0 commit comments

Comments
 (0)