`gh pr merge` gives uninformative error message: "base branch policy prohibits the merge"
- Ngôn ngữ chính
- Go
- Star
- 46.3k
- Fork
- 9k
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 97
Mô tả
### 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
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ lệnh `gh pr merge` và theo dõi cách lệnh này báo cáo lỗi vi phạm chính sách của nhánh cơ sở. Sử dụng các ví dụ về kiểm tra bắt buộc và phê duyệt của maintainer làm các trường hợp chấp nhận, đồng thời đảm bảo lỗi cuối cùng xác định lý do bảo vệ nhánh đã chặn merge.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github, go
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100