Spencer Goff
Spencer Goff

Reputation: 1192

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

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.

Upvotes: 11

Views: 3742

Answers (2)

LTX
LTX

Reputation: 99

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

Upvotes: 1

Spencer Goff
Spencer Goff

Reputation: 1192

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.

Upvotes: 7

Related Questions