githubgithub-rulesets

What does the message "Merge is not an allowed merge method in this repository" indicate in a GitHub PR?


After introducing a branch Ruleset in my GitHub repo, PRs are blocked from merging with this confusing message:

Merge is not an allowed merge method in this repository.

Blocked PR screenshot

In the ruleset I specified Merge as the only "Allowed merge methods" (note the confusing UI wording there).

Ruleset merge methods setting

So why are PRs blocked when I've explicitly allowed "Merge" as the PR merge method?


Solution

  • This confusing UI results from a conflict (or disagreement) within the repository settings. The ruleset has dictated that the only type of PR merge is a simple Merge (confusing redundancy in the terminology aside), meaning Squash and Rebase are not allowed for PR merges.

    However, in the General repo settings, under the Pull Requests section, you can also specify which types of merge are allowed for PRs.

    General repo PR settings

    As you can see, there's nothing in the UI to force the two settings to be in agreement (or even highlight when they are not). In this case they combine in such a way that PRs have no allowed merge method.

    The error message that GitHub gives is extremely confusing (mostly due to the multiple uses of the work "merge" here, same as in the settings UI); it should just say something like "Multiple repository settings have combined to restrict all merge methods for this PR."

    The fix is to align the two settings: whatever Merge methods you allow in the ruleset should match (or at least not conflict with) the ones you select in the General settings. Since rulesets are aggregated with (layered on top of) general repo settings (including Branch protections), it might be best to allow all merge methods in the General settings and restrict them in your ruleset(s).