Uh oh!
There was an error while loading. Please reload this page.
fix: pass github-token to primary checkout in stable-sync action - #276
Merged
Conversation
The main repo checkout step didn't forward the elevated github-token
input to actions/checkout, so it silently fell back to the caller's
default GITHUB_TOKEN for persisted git credentials. When a consuming
workflow scopes its job-level permissions down to just id-token: write
(as metamask-mobile's stable-branch-sync.yml does after migrating to
OIDC token exchange), that default token has no contents:write, and
the branch push later in this action fails with a 403:
remote: Permission to MetaMask/metamask-mobile.git denied to github-actions[bot].
fatal: unable to access '...': The requested URL returned error: 403
Since the push fails, the subsequent "Create Pull Request" step is
skipped, so no stable -> main sync PR ever gets opened.
This mirrors the sibling release-branch-sync action, which already
passes token: ${{ inputs.github-token }} on its primary checkout.
Co-authored-by: Cursor <cursoragent@cursor.com>Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
stable-sync's firstactions/checkoutstep (checking out the consuming repo, e.g.metamask-mobile) never forwards the action's owngithub-tokeninput. It relies onactions/checkout's default (github.token), which is only as privileged as the calling job'spermissions:block.metamask-mobile'sstable-branch-sync.ymlmigrated to OIDC token exchange (#32331 there), and itsrun-stable-syncjob now scopes its ownpermissions:down to justid-token: write. Job-levelpermissions:replaces (not merges with) the workflow-level block, so the defaultGITHUB_TOKENfor that job has nocontents: write— it's read-only (Metadata: read).Meanwhile the elevated, narrowly-scoped token obtained via OIDC exchange is passed into this action as
github-token, but is only wired into the finalgh pr createstep. The checkout step (whose persisted git credentials are whatgit pushat the end of this action actually uses) never sees it.Net effect: the branch push at the end of
run-stable-syncfails every time with:Since that step fails, the following
Create Pull Requeststep is skipped, so nostable -> mainsync PR is ever opened. This has been silently broken formetamask-mobilesince ~2026-07-13 (once the OIDC-migrated workflow reached itsstablebranch) — see runs 29279657644, 29439944223, 29787290543, 30291849225, 30655332762, 31421433607.Fix
Pass
token: ${{ inputs.github-token }}on the primary checkout, matching the siblingrelease-branch-syncaction, which already does this correctly and has never had this issue:Follow-up (in metamask-mobile, not part of this PR)
Once a new tag is cut with this fix,
metamask-mobile's.github/workflows/stable-branch-sync.ymlneeds itsstable-sync@v1.16.0pin bumped to pick it up, and astablepush (or manual re-run) will be needed to generate the missingstable-main-X.Y.Z -> mainsync PR(s).Test plan
metamask-mobile'sstable-branch-sync.yml) and re-run/push to confirm the checkout now persists the elevated token and the branch push + PR creation succeedMade with Cursor