metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

chore: INFRA-3187: Added workflow to auto-merge old release branches into ne…

Open XxdpavelxX opened this issue 1 month ago • 3 comments

…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

  1. Multiple branches, one already merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20072233678
  2. Multiple branches, neither merged: https://github.com/consensys-test/metamask-mobile-test-workflow/actions/runs/20073029520
  3. 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

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.Z branches 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-AutomateMergingReleaseBranches to merge older release branches into the new one using new-release-branch and github-token inputs.

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

XxdpavelxX avatar Dec 09 '25 18:12 XxdpavelxX

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.

github-actions[bot] avatar Dec 09 '25 18:12 github-actions[bot]

🔍 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:

  1. This is a pure CI/CD infrastructure change - a new workflow file being added
  2. The workflow only triggers on branch creation events (specifically release/* branches)
  3. It does not modify any application code, test code, or test infrastructure
  4. It has no relationships with other CI workflows or scripts
  5. 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.

View GitHub Actions results

github-actions[bot] avatar Dec 16 '25 15:12 github-actions[bot]