`gh pr merge` gives uninformative error message: "base branch policy prohibits the merge"
- Dominant language
- Go
- Stars
- 46.3k
- Forks
- 9k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 89
Description
### Describe the feature or problem you’d like to solve
A clear and concise description of what the feature or problem is.
```console
$ gh pr merge https://github.com/foo/bar/pull/123 --merge
X Pull request #123 is not mergeable: the base branch policy prohibits the merge.
```
There are several different [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule) that one could have on a branch, so this error message doesn't really explain *why* the merge failed. Was it because a required check didn't pass? Was it because the PR wasn't approved by a maintainer? etc etc etc
### Proposed solution
Provide more context on *why* the merge failed, i.e. which branch protection rules have blocked it. e.g.
```
X Pull request #123 is not mergeable: the base branch policy prohibits the merge: required check "Build" has not passed
```
or
```
X Pull request #123 is not mergeable: the base branch policy prohibits the merge: PR requires approval from a maintainer
```
Contributor guide
Assessment
This issue has not been assessed yet.