Skip to content

Conversation

sethkfman
Copy link
Contributor

@sethkfman sethkfman commented Oct 3, 2025

Description

Summary

Add validation to ensure release builds only proceed with correct commit message format.

Changes

  • Added new workflow step: check_release_commit_message that validates commit messages contain the expected pattern [skip ci] Bump version number to
  • Integrated validation: Added the check to both Android and iOS release workflows (build_android_rc_and_upload_sourcemaps and build_ios_rc_and_upload_sourcemaps)
  • Fail-safe behavior: If commit message doesn't match expected pattern, the workflow fails and instructs the user to run a version bump command requiring a release build to be a new number.

Technical Details

  • The validation step uses BITRISE_GIT_MESSAGE environment variable to check the commit message
  • Uses grep -q to perform pattern matching without output
  • Implements proper error handling with set -e and set -o pipefail
  • Includes debug logging with set -x

Purpose

This change helps prevent accidental release builds by ensuring only commits with the proper version bump message format trigger the release workflow, improving CI/CD reliability and preventing unintended releases.

Files Modified

  • bitrise.yml - Added commit message validation workflow step

Commit: 797ced05a2 - added check to fail release build if it doesn't contain the correct commit number

Changelog

CHANGELOG entry:

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

Testing

  • Verify the workflow step executes correctly
  • Test with both valid and invalid commit messages
  • Confirm release workflows still function as expected

Expected PASS

Expected FAIL

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

Enforces a commit-message check before release builds and bumps all build numbers to 2649 across CI and iOS project configs.

  • CI/CD:
    • Add check_release_commit_message workflow to validate BITRISE_GIT_MESSAGE matches [skip ci] Bump version number to and fail with guidance otherwise.
    • Invoke this check in build_android_release_and_upload_sourcemaps and build_ios_release_and_upload_sourcemaps.
  • Versioning:
    • Bump VERSION_NUMBER and FLASK_VERSION_NUMBER in bitrise.yml to 2649.
    • Update iOS CURRENT_PROJECT_VERSION to 2649 across MetaMask, MetaMask-Flask, and MetaMask-QA configurations in ios/MetaMask.xcodeproj/project.pbxproj.

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

Copy link
Contributor

github-actions bot commented Oct 3, 2025

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-mobile-platform Mobile Platform team label Oct 3, 2025
@github-actions github-actions bot added the size-S label Oct 3, 2025
@sethkfman sethkfman marked this pull request as ready for review October 3, 2025 22:45
@sethkfman sethkfman requested a review from a team as a code owner October 3, 2025 22:45
cursor[bot]

This comment was marked as outdated.

weitingsun
weitingsun previously approved these changes Oct 3, 2025
echo "BITRISE_GIT_MESSAGE: $BITRISE_GIT_MESSAGE"
if ! echo "$BITRISE_GIT_MESSAGE" | grep -q "\[skip ci\] Bump version
number to"; then
Copy link

Choose a reason for hiding this comment

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

Bug: Multiline YAML Pattern Causes Commit Message Validation Failure

The grep pattern for checking the commit message is split across two lines in the YAML, causing it to search for a literal newline character. This prevents the workflow from correctly identifying valid release commit messages.

Fix in Cursor Fix in Web

Copy link

sonarqubecloud bot commented Oct 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants