Skip to content

Conversation

@XxdpavelxX
Copy link
Contributor

@XxdpavelxX XxdpavelxX commented Nov 21, 2025

Description

Allows you to merge stable-main-X.Y.Z -> base 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

CHANGELOG entry: None

Related issues

Fixes:

Manual testing steps

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

Before

After

Pre-merge author checklist

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.

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.

Written by Cursor Bugbot for commit e56215b. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-dev-ops DevOps team label Nov 21, 2025
@XxdpavelxX XxdpavelxX self-assigned this Nov 21, 2025
@XxdpavelxX XxdpavelxX changed the title INFRA-2925:Adding github action to merge stable to main on comment chore: INFRA-2925:Adding github action to merge stable to main on comment Nov 21, 2025
github.event.issue.pull_request &&
github.event.comment.body == 'Merge my PR' &&
(
github.event.comment.author_association == 'COLLABORATOR' ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want collaborators to be able to merge?

Copy link
Contributor Author

@XxdpavelxX XxdpavelxX Nov 25, 2025

Choose a reason for hiding this comment

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

I assumed so if the PR is approved by a release team member, but if not then let me remove that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the collaborator is anyone who can write to the repo. Should we constrain this to a specific team like Release Team?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed collaborator.

@XxdpavelxX XxdpavelxX requested a review from Gudahtt November 26, 2025 19:20
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

This PR adds a new GitHub Actions workflow file (.github/workflows/merge-approved-pr.yml) that provides a convenience feature for merging approved PRs via a comment command.

Key observations:

  1. This is a completely new file (not modifying existing code)
  2. The workflow is purely for GitHub automation - it triggers when a comment "Merge my PR" is posted by a MEMBER or OWNER on a PR
  3. It calls a reusable workflow from MetaMask/github-tools repository to handle the actual merge
  4. This workflow does NOT affect:
    • Application code
    • Build processes
    • Test infrastructure
    • E2E testing frameworks
    • Any runtime behavior of the MetaMask Mobile app
  5. No other files in the codebase reference this workflow
  6. This is a developer workflow tool that only impacts the GitHub PR merge process

Impact Assessment:

  • Zero impact on application functionality
  • Zero impact on E2E test execution or infrastructure
  • This is pure CI/CD automation for repository management
  • The workflow only affects how PRs are merged, not what code is merged or how it's tested

Risk Level: Low - This is a documentation/infrastructure-only change with no impact on the application or its testing.

Recommendation: No E2E tests are necessary for this change. The workflow itself can be validated through GitHub Actions execution, but it doesn't require functional testing of the MetaMask Mobile application.

View GitHub Actions results

@sonarqubecloud
Copy link

@XxdpavelxX XxdpavelxX requested a review from sethkfman November 26, 2025 20:13
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@XxdpavelxX XxdpavelxX added this pull request to the merge queue Nov 26, 2025
Merged via the queue into main with commit 67bf281 Nov 26, 2025
58 checks passed
@XxdpavelxX XxdpavelxX deleted the INFRA-2925-AddMergingGithubAction branch November 26, 2025 21:35
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2025
@metamaskbot metamaskbot added the release-7.61.0 Issue or pull request that will be included in release 7.61.0 label Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.61.0 Issue or pull request that will be included in release 7.61.0 size-S team-dev-ops DevOps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants