ci: add auto-merge required gate#2596
Merged
Merged
Conversation
joshka
enabled auto-merge (squash)
June 13, 2026 05:46
Add a single aggregate CI status that repository protection can require. This gives GitHub auto-merge a stable check to wait on while the matrix jobs finish.
joshka
force-pushed
the
joshka/auto-merge-required-gate
branch
from
June 13, 2026 06:01
96be179 to
22172b7
Compare
orhun
approved these changes
Jun 13, 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
This makes GitHub auto-merge usable for Ratatui PRs once maintainers are happy with the change but CI is still running.
The workflow change adds a single aggregate
requiredjob to the main CI workflow. The repository now has auto-merge enabled and anensure checks passruleset that requires thatrequiredstatus context onmain.Why
Without a required status context, GitHub's auto-merge button is not useful for the maintainer flow we want. The goal is to let a maintainer review a PR, decide it is ready, click auto-merge, and move on without coming back later just to check whether the remaining jobs finished.
This does not relax the merge policy. GitHub's own auto-merge behavior is to merge only after all required reviews and required status checks are satisfied. This change gives GitHub a stable required status to wait on automatically.
Precedent
I have been using this same auto-merge pattern in
ratatui/tui-widgets, where it has worked well for the intended maintainer flow: once a PR looks ready, I can enable auto-merge and let GitHub merge it after the remaining checks and review requirements are satisfied.How it works
The new
requiredjob depends on the main CI jobs in.github/workflows/ci.ymland always runs after them. It fails if any required dependency fails, is cancelled, or is skipped.The repository ruleset requires only this aggregate
requiredcontext instead of requiring every individual matrix job separately. That gives GitHub one stable status to wait on while preserving the existing CI coverage.Things to know
requiredworkflow job.required.needslist or it will not be represented by the aggregate gate.required.needs, because skipped, cancelled, and failed dependencies make the aggregate fail.Current PR state
Auto-merge is already enabled on this PR. If you approve it and the required checks pass, GitHub will squash-merge it automatically; approving it is enough to let the PR merge once the remaining requirements are satisfied.
GitHub docs
Validation
ruby -e 'require "yaml"; YAML.load_file(".github/workflows/ci.yml"); puts "ok"'actionlint .github/workflows/ci.ymlratatui/ratatuihasallow_auto_merge: trueensure checks passruleset requires status contextrequired