fix(automerge): merge only as the deploy-bot app and guard post-merge actor - #20
Merged
Merged
Conversation
… actor Remove every GITHUB_TOKEN merge path. The App token is now required (job fails if it cannot be minted), transient merge refusals are retried as the App, and a post-merge guard verifies the merge actor. A github-actions merge gets its push-triggered deploy workflows dispatched and fails the job with a clear error. The sweep re-checks the last 24h of merges because a GITHUB_TOKEN merge fires no closed event. Refs Emkraan/emkraan-apps#1798
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.
Root cause
emkraan-apps #1793 was merged as
github-actions[bot]by automerge run 36076490388 (workflow_run). The App token minted fine and the App enabled native auto-merge earlier (run 36076462710). At 00:13:38 the App's directmergePullRequestwas refused with "Base branch was modified. Review and try the merge again." because a concurrent run (36076510468) had merged #1779 one second earlier.mutate()treated any App refusal as a reason to retry as GITHUB_TOKEN, and that retry merged9d411fcas github-actions, so no push workflows (includingdeploy-image-revive) started.Changes
continue-on-error, and there is no|| secrets.GITHUB_TOKENfallback. No merge, auto-merge or enqueue mutation runs as GITHUB_TOKEN anywhere.pull_request: closed, and on every sweep for PRs merged in the last 24h (a GITHUB_TOKEN merge fires no closed run), the merge actor is checked. If it isgithub-actions[bot]and no push run exists for the merge commit, every active workflow with a matchingpushtrigger (branch andpaths/paths-ignorefilters evaluated against the PR files) that declaresworkflow_dispatchis dispatched on the base branch, and the job emits an error and fails. Idempotent: skips workflows already dispatched since the merge.actions: write.Follow-up
Fleet callers (including emkraan-apps
automerge.yml, currentlyactions: read) needactions: writefor the guard dispatch; without it the guard still errors loudly and lists the workflows to run by hand.Refs Emkraan/emkraan-apps#1798