GitHub auto-merge option isn't showing in pull requests

2.8k views Asked by At

According to GitHub's docs, after enabling "Allow auto-merge" in my repo settings, I should see a button that says "Enable auto-merge" in my pull requests. I do not.

enter image description here

enter image description here

I've opened new PRs, toggled the types of merging allowed, and switched my repo visibility to public, but nothing has worked.

2

There are 2 answers

2
Spencer Goff On BEST ANSWER

I resolved this by applying a branch protection to the main branch. Pull requests raised after that time now show the "Enable auto-merge" button.

This makes sense because, if the base branch is unprotected, the PR would merge immediately after being raised since status checks typically take at least a couple of seconds to report a "pending" status.

0
LTX On

I was having the same problem and just want to complement the right answer and make the comprehension easier.

You need to:

  • Activate auto-merge in the base branch;
  • Protect the base branch checking "Require pull request reviews before merging" or "Require status checks to pass before merging";
  • Select which status checks are required in order to merge automatically, as this image shows select status checks

Then auto-merge option will show: auto merge showing

Source: docs