feat(auto-merge-deps): gate auto-merge on required PR check-runs#21
Merged
Conversation
Adds a `required-checks` input (newline- or comma-separated) to the
composite action. When set, the action queries the Checks API for the
PR head SHA and requires each listed check-run to be `completed` with
`conclusion=success` before calling `gh pr merge --auto`. Missing,
pending, or failing checks exit cleanly with
`skip:check:{missing,pending,failed}` and a log line naming the check.
Empty input preserves prior behaviour — enforcement falls back to the
caller repo's branch protection. This is defense-in-depth so the
action's "safe auto-merge" intent holds even when a repo forgets to
mark its build as required.
Closes #20.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
required-checksinput (newline- or comma-separated) to theauto-merge-depscomposite action.gh api repos/{owner}/{repo}/commits/{sha}/check-runsfor the PR head SHA and requires each listed check-run to becompleted+conclusion=successbefore callinggh pr merge --auto.skip:check:{missing,pending,failed}and a log line naming the offending check.checks-jsontest seam.Closes #20.
Test plan
auto-merge-decisionsmatrix passes (existing 9 + new 7 cases).promptlm-clients/.github/workflows/auto-merge-deps.yml(and other callers) passingrequired-checks: oss-checks / run.🤖 Generated with Claude Code