ci: restrict production OTA pushes to release branch PRs#30286
Open
weitingsun wants to merge 2 commits into
Open
ci: restrict production OTA pushes to release branch PRs#30286weitingsun wants to merge 2 commits into
weitingsun wants to merge 2 commits into
Conversation
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. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adds a hard guardrail to the OTA push workflow so that production channel updates can only be dispatched from a PR whose head branch matches
release/*. Previously, anyone with workflow dispatch permissions could push an OTA update to the production channel from any PR — the only safeguards downstream were the release-team approval step and the fingerprint comparison, neither of which protects against pushing the wrong branch's code to production users.This change introduces a new dedicated job,
verify-release-branch, that runs early inpush-eas-update.yml:exp/rcchannels — the job logs an info message and exits 0 (no behavior change for non-production flows).productionchannel — the job fetches the target PR via the GitHub API, readshead.ref, and fails the run with a clear annotation and step-summary block if the head branch does not matchrelease/*.The gate is added to the
needs:of the expensive downstream jobs (setup-dependencies,setup-dependencies-base,prepare,push-update) so a doomed production run fails fast — saving ~5–10 minutes of CI per misfire — and surfaces as its own red box in the Actions UI labelled "Verify release branch (production only)", rather than being buried inside the existingvalidate-prstep.Because the check lives inside
push-eas-update.ymlitself, it is automatically inherited by every caller that invokes the workflow viaworkflow_call:runway-ota-production.yml(hardcodedchannel: production) — gate enforcedrunway-ota-rc.yml(hardcodedchannel: rc) — gate skippedauto-rc-ota-build-core.yml(dynamicchannel) — gate enforced only when the dynamic channel resolves toproductionNo changes are required in any caller workflow.
workflow tests:
from non release branch to production (fail): https://github.com/MetaMask/metamask-mobile/actions/runs/25946843695
from release branch to production (pass):
https://github.com/MetaMask/metamask-mobile/actions/runs/25946935860
from non release branch to non production (pass):
https://github.com/MetaMask/metamask-mobile/actions/runs/25946974294
Changelog
CHANGELOG entry:null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes the production OTA release workflow gating; a misconfiguration or GitHub API/JQ failure could incorrectly block legitimate production updates.
Overview
Adds a new
verify-release-branchjob topush-eas-update.ymlthat blocks production OTA updates unless the target PR’s head branch matchesrelease/*, using the GitHub API to readhead.refand emitting clear run summaries/errors.Wires this guard into the
needs:chain for the expensive downstream jobs (setup-dependencies,setup-dependencies-base,prepare,push-update) so invalid production runs fail fast, while non-production channels (exp/rc) explicitly skip the check.Reviewed by Cursor Bugbot for commit f89dc9e. Bugbot is set up for automated code reviews on this repo. Configure here.