Required merge queue branch protection rule bypassed by REST merge API #203246
Unanswered
AgentAntelope
asked this question in
Repositories
Replies: 1 comment
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
Body
Setup
Our default branch main has “Require merge queue” enabled via a classic branch protection rule: admin-enforced, with no bypass actors and no push restrictions. There is also a repository ruleset targeting the same branch whose merge_queue rule is currently in evaluate mode, as we assess moving to rulesets.
Human merges through the web UI are correctly routed through the queue.
Expected
With “Require merge queue” active on the branch protection rule, no actor lacking an explicit bypass should be able to land a merge on main outside the queue, regardless of how they merge.
Actual
An account with only write permission and no bypass grant can merge pull requests directly via PUT
/repos/OWNER/REPO/pulls/{n}/merge, landing on our protected branch without ever entering the queue.Evidence
Comparing a bypassed merge (#NNN) with a normal UI merge (#MMM):
Bypassed merge queue PR: commit committer is web-flow; PR timeline shows a bare merged event with no added_to_merge_queue.
Normal PR (UI merge): timeline shows added_to_merge_queue -> github-merge-queue[bot], as expected.
The merging account has write (not admin);
enforce_admins = true; the branch rule has nobypass_pull_request_allowancesand no push restrictions.Rule Insights rule-suite for #NNN: The evaluation in the suite came from our evaluate-mode ruleset (result fail: “Changes must be made through the merge queue”), which doesn’t block at the moment. It appears the branch protection rule merge queue requirement simply isn’t evaluated against the API merge.
Questions
We will probably move to rulesets to solve this issue, as they seem to work as intended (at least based on the evaluation runs).
All reactions