ci(automerge): add reusable fleet automerge workflow with self-aware readiness - #17
Merged
Merged
Conversation
…readiness One implementation replaces 13 hand-copied automerge.yml variants that had drifted into 3 readiness rules. A PR is ready when CLEAN, or UNSTABLE where every non-green check belongs to the automerge workflow itself: the running automerge job pins the PR UNSTABLE, so gating on CLEAN alone stranded readied drafts (apollo#1037). Non-required red checks still block. Adds the app-token-with-GITHUB_TOKEN-fallback identity, merge-queue enqueue, head_sha matching, linked-issue closing, expectedHeadOid merges and the paginated sweep. This repo's own caller uses the local path so changes self-test.
cmarko89
marked this pull request as ready for review
September 23, 2026 02:27
This was referenced Sep 23, 2026
Merged
Merged
ci(automerge): delegate to the fleet reusable automerge workflow
Emkraan/homeassistant-franklinwh#23
Merged
Merged
Merged
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.
Summary
Adds
.github/workflows/reusable-automerge.yml, the single fleet implementation of PR auto-merge, and converts this repo'sautomerge.ymlinto a thin caller (local path, so changes here self-test on their own PR).Why
13 repos carried hand-copied
automerge.ymlfiles that had drifted into 5 variants with 3 different readiness rules. On repos that gate onCLEANonly, a draft marked ready after its checks went green strands open forever. The running automerge job is itself a non-required check, so the PR readsUNSTABLEfor that run's whole life, native auto-merge is refused ("unstable status"), and no later event fires. This stranded Emkraan/apollo#1037 on 2026-09-22.Readiness rule
Ready =
CLEAN, orUNSTABLEwhere every non-green check on the head commit belongs to the automerge workflow itself (matched by workflow name or run id, so two concurrent automerge runs on one SHA do not wait on each other). A red or pending non-required check still blocks. An unreadable check rollup fails closed. The rollup is read withGITHUB_TOKEN, since the deploy-bot App token cannot read checks.Kept from the existing variants
GITHUB_TOKENretry (the App cannot merge.github/workflows/**changes)enqueuePullRequestwhen readymergePullRequestwithexpectedHeadOid; poll-and-merge on the "clean status" auto-merge raceworkflow_runhead-SHA matching whenpull_requestsis emptyVerification
Rollout
After merge, each fleet repo's
automerge.ymlis replaced by a thin caller pinned to@main(the existingha-shared-workflowsprecedent). The Apollo standard update (github-repo-standard.mdS8 andfleet-compliance.pyS8-automerge) lands alongside.