Skip to content

Merge branch 'release/test-runway-rc-ios-workflow' of github.com:Meta… #1020

Merge branch 'release/test-runway-rc-ios-workflow' of github.com:Meta…

Merge branch 'release/test-runway-rc-ios-workflow' of github.com:Meta… #1020

# On every push to a release branch (release/x.y.z format), this workflow rebuilds the matching
# changelog branch, re-runs the auto-changelog script, and either updates or recreates the changelog PR.
# Note: This workflow validates the branch name to ensure it matches the semantic versioning pattern
# (release/x.y.z) and skips execution for other branch names like release/x.y.z-Changelog.
name: Update Release Changelog PR
on:
push:
branches:
- 'release/*'
concurrency:
group: update-release-changelog-${{ github.ref }}
cancel-in-progress: false
jobs:
validate-branch:
name: Validate release branch format
runs-on: ubuntu-latest
outputs:
is-valid-release: ${{ steps.check.outputs.is-valid }}
version: ${{ steps.check.outputs.version }}
steps:
- name: Check if branch matches release/x.y.z pattern
id: check
run: |
BRANCH_NAME="${{ github.ref_name }}"
echo "Checking branch: $BRANCH_NAME"
# Validate branch matches release/x.y.z format (semantic versioning)
if [[ "$BRANCH_NAME" =~ ^release/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="${BRANCH_NAME#release/}"
echo "Valid release branch detected: $BRANCH_NAME (version: $VERSION)"
echo "is-valid=true" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
else
echo "Branch '$BRANCH_NAME' does not match release/x.y.z pattern. Skipping changelog update."
echo "is-valid=false" >> "$GITHUB_OUTPUT"
fi
refresh-changelog:
name: Update changelog
needs: validate-branch
if: needs.validate-branch.outputs.is-valid-release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Update Release Changelog
uses: MetaMask/github-tools/.github/actions/update-release-changelog@v1
with:
release-branch: ${{ github.ref_name }}
repository-url: ${{ github.server_url }}/${{ github.repository }}
platform: mobile
previous-version-ref: 'null'
github-token: ${{ secrets.PR_TOKEN }}