feat(agent-approval-check): support merge queue (merge_group) - #54
Merged
Conversation
Handle the merge_group event by posting a success status on the merge-group head commit. A required status check must also report on merge-group commits or queued pull requests are dropped after the merge-queue check timeout. A pull request can only enter the queue after branch protection (including this check on the PR head) already passed, so the approval requirement was enforced before the merge-group commit was created.
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
Makes the
agent-approval-checkaction compatible with GitHub merge queues.When the required status check's workflow only listens for
pull_request*events, merge-group commits never emit the check, and queued pull requests are dropped after the merge-queue check timeout. This adds handling for themerge_groupevent: the action posts asuccessstatus on the merge-group head commit.This is safe because a pull request can only enter the merge queue after branch protection (including this check on the pull-request head) has already passed, so the approval requirement was enforced before the merge-group commit was created.
Consumer change
Workflows on merge-queue branches must add the
merge_grouptrigger (and includegithub.event.merge_group.head_refin the concurrency group). See the README.Testing
python3 -m unittest discover -s actions/agent-approval-check -p 'test_*.py' -v(23 passing)