A bypass actor can merge a PR without approval, but auto-merge and the merge queue never let it #208718
Replies: 2 comments
|
💬 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. ⭐ |
|
I couldn't find it documented either. GitHub's ruleset docs only describe bypass as something an actor uses when it merges or pushes. Auto-merge and the merge queue instead check whether the pull request itself meets the rules, so a required approval stays unmet no matter who turned auto-merge on. Your test repo shows exactly that. Renovate's docs add to the confusion: for required reviews they point to the bypass option (automerge docs), which only helps while Renovate merges directly. Two setups that work with a required approval:
Your test repo is a clean reproduction, so it's worth sending to GitHub through feedback or support as well. At the very least, the bypass setting should say that it doesn't apply to auto-merge or the merge queue. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
Body
I have a branch rule that requires one approval before merging. I added a GitHub App to the bypass list of that rule. The app can merge its own PRs with no approval when it calls the merge API directly. That works.
But if the app turns on auto-merge instead, the PR never merges. It stays blocked with "Review required" forever, even when all checks are green. The same happens with a merge queue: the PR never enters the queue. If the app tries to add the PR to the queue itself, GitHub refuses with "At least 1 approving review is required by reviewers with write access."
So the bypass only counts when the actor clicks merge or calls the merge API. It does not count for auto-merge or for the merge queue. I could not find this written anywhere, and the settings page does not warn about it.
I use Renovate, which opens dependency update PRs through a GitHub App and turns on auto-merge by default. With an approval rule and a bypass, none of those PRs ever merge. The only setup that works is to make Renovate call the merge API itself. That means no merge queue at all, and Renovate merges only one PR per run.
What I tested
I built a public test repository for this: https://github.com/gwenneg-mq-lab/mq-bypass-lab. All the PRs and their timelines are still there, and the README says which rules were on for each PR, with a link to every one of them. Each PR was opened by a private GitHub App running Renovate. The rules on
mainwere: one required approval, one required check calledcithat runs on pull requests and on merge groups, and in some tests a merge queue. Auto-merge is allowed in the repository settings. For every test that failed, I waited at least 20 minutes, then did something on the same PR that should work, to make sure the setup itself was fine.enqueuePullRequestenqueuePullRequestenqueuePullRequestI tested with Renovate 43.268.1 and 44.111.4. The newer one tries to add the PR to the merge queue itself when the merge API refuses, and that is refused too.
The problems I see
enqueuePullRequestis refused.What I would expect
When someone on the bypass list turns on auto-merge or adds a PR to the merge queue, the approval rule should be treated as met, the same way it is when that person merges directly. If that is not how it is meant to work, the settings page should say so when a bypass actor is combined with auto-merge or a merge queue, and the docs should say it too.
Earlier reports
Other people have hit this before: #142206, #162623, #190610 and #203926 here, and on the Renovate side renovatebot/renovate#28156 and renovatebot/renovate#31315. None of them got an answer with a fix. I am opening this one because I now have a full public reproduction to point at.
All reactions