Repository navigation
Trigger auto-merge on approval, not just on CI completion - #348
Merged
Merged
Conversation
The prior revision only fired on ``workflow_run`` of "Pull Request or Push" completing. When CI went green before a human had approved, the one chance to run the auto-merge step came and went with zero approvals recorded, and the PR then sat open indefinitely -- the approval event alone didn't re-trigger anything. This bit us on PR #347 (Release 0.23.2) which had green CI for two days before approval; after approval it still had to be merged by hand. Add a ``pull_request_review`` trigger and a shared resolution step that figures out the PR + head SHA regardless of which event fired. The merge step now: * re-verifies the ``automated-update`` label on the PR * requires at least one approving review (unchanged) * requires every status check to be ``COMPLETED`` with conclusion in ``{SUCCESS, SKIPPED, NEUTRAL}`` -- the previous version relied on the ``workflow_run`` ``if`` guard for this, which doesn't help when the entry point is a review event So either ordering now unblocks: CI-then-approval (workflow_run fires, approval already in place) or approval-then-CI (pull_request_review fires, waits for CI, next workflow_run completion then merges). The merge is still ``--squash --delete-branch`` and the App token path is unchanged.
ubuntu-latest rolled to 26.04 "resolute" in Nov 2026, which dropped the
bare ``libxml2`` runtime package from the archive. Every pre-commit CI
run since then fails during ``apt-get install`` with::
E: Package 'libxml2' has no installation candidate
breaking the pre-commit gate for every open PR. ``libxml2-dev`` is
still in resolute and pulls the current ``libxml2``-ABI runtime SONAME
package in transitively, so dropping just the bare ``libxml2`` entry
from the install list is enough. Rest of the package list is
unchanged.
twangboy
approved these changes
Nov 19, 2026
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
Closes a gap in the automated-update release flow where CI-then-approval ordering left PRs sitting unmerged.
The existing
.github/workflows/auto-merge.ymlonly fires onworkflow_runof "Pull Request or Push" completing. When CI goes green before a human approves, the auto-merge job runs once, finds zero approving reviews, exits, and never re-fires — because a bare approval doesn't retrigger aworkflow_run. The PR then stalls waiting on a manual merge.Reproduced on PR #347 (Release 0.23.2) which had green CI for two days before approval; after approval it still had to be merged by hand.
Changes
pull_request_reviewtrigger (types: [submitted]) alongside the existingworkflow_run.workflow_run.head_shavspull_request.head.sha).automated-updatelabel is still on the PR (defence in depth)APPROVEDreview (unchanged)statusCheckRollupentry to beCOMPLETEDwith conclusion in{SUCCESS, SKIPPED, NEUTRAL}. The previous version got this from theworkflow_runifguard, which is useless on the review-event path.--squash --delete-branch, App token acquisition unchanged.Now either ordering unblocks automatically:
pull_request_reviewfires → CI already green → merges.pull_request_reviewfires → CI still running → script waits. Nextworkflow_runcompletion fires → approval already there → merges.Test plan
automated-update-labelled PR, let CI finish, approve, confirm it merges without manual intervention.workflow_runcompletion.