chore: INFRA-3187: Added workflow to auto-merge old release branches into ne…
…w one
Description
Adds a workflow and script to automatically merge all older release/X.Y.Z branches into a newly created release branch, favoring the destination on conflicts.
CI/CD: New workflow /.github/workflows/merge-previous-releases.yml: Triggers via workflow_call or workflow_dispatch with new-release-branch input. Checks out repo and metamask/github-tools, configures git user, and runs merge script. New script /.github/scripts/merge-previous-releases.sh: Parses release/X.Y.Z branches, filters/sorts older versions, and merges them into NEW_RELEASE_BRANCH. Uses -X ours to resolve conflicts favoring destination; skips already merged branches; pushes only if merges occurred. Logs actions and summarizes merged vs skipped branches.
Testing: https://github.com/consensys-test/metamask-mobile-test-workflow/pull/59
- Multiple branches, one already merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20072233678
- Multiple branches, neither merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20073029520
- Multiple branches, with merge conflicts: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20073136324
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
- [ ] I’ve followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
- [ ] 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 format if applicable
- [ ] I’ve applied the right labels on the PR (see labeling guidelines). 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.
[!NOTE] Adds a GitHub Actions workflow that validates new
release/X.Y.Zbranches and auto-merges older release branches into the new one.
- CI/CD:
- New workflow
/.github/workflows/merge-previous-release-branches.yml:
- Validates branch creation matches
release/X.Y.Z.- If valid, runs action
metamask/github-tools/.github/actions/merge-previous-releases@INFRA-3187-AutomateMergingReleaseBranchesto merge older release branches into the new one usingnew-release-branchandgithub-tokeninputs.Written by Cursor Bugbot for commit a0808980266ffe014ca1743c50417425b99e0762. This will update automatically on new commits. Configure here.
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.
🔍 Smart E2E Test Selection
- Selected E2E tags: None (no tests recommended)
- Risk Level: low
- AI Confidence: 98%
click to see 🤖 AI reasoning details
This PR adds a new GitHub Actions workflow file (.github/workflows/merge-previous-release-branches.yml) that automates the merging of previous release branches when a new release branch is created.
Key observations:
- This is a pure CI/CD infrastructure change - a new workflow file being added
- The workflow only triggers on branch creation events (specifically release/* branches)
- It does not modify any application code, test code, or test infrastructure
- It has no relationships with other CI workflows or scripts
- The workflow uses an external GitHub action (metamask/github-tools/.github/actions/[email protected]) for the actual merge logic
This change has zero impact on the mobile application functionality, user flows, or E2E test infrastructure. It's purely a release management automation workflow that runs independently of the app's testing pipeline. No E2E tests are needed to validate this change.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code