-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you’d like to solve
On GitHub.com UI, merging is blocked when a repository is configured to require approval(s).
If I'm an admin of the repository, I can use my administrator privileges like below.
To merge this PR, the UI shows a checkbox to confirm that I surely know I'm using my administrator privileges.
However, the current gh (v0.10.0) can merge a PR without such confirmation.
Proposed solution
I personally feel gh should follow the UI's behaviour because it is safer and better to indicate it explicitly. On the other hand, it makes additional user interaction and could be annoying if gh always ask us to check it. 🤔
I think there are some options.
- Keep the current behaviour as
gh's spec- In this case,
ghconsiders that a user surely knows what they are doing with their administrator privileges - If it's already discussed and all intentional, please close this issue 🙇
- In this case,
- Always confirm the privileges
- Check BranchProtectionRule status before merge
- Probably, it is the first question like below and "No" by default
$ gh pr merge 636 ? Use your administrator privileges to merge this pull request? [y/N] - Always confirm the privileges as same as above but add
--forceflag togh pr mergeto avoid the question (My preference)- Bonus:
gh forceMerge 123provided bygh alias set forceMerge pr merge --forcecan change the default behaviour if a user wants
- Bonus:
- Confirm administrator privileges to merge a pull request when a repository requires it #1198 (comment): Always reject to merge a pull request unless a user set
--forceoption
Additional context
I found this necessity through the following interactions (Especially for handling a bunch of PRs generated by dependabot).
$ gh pr list # List up PR numbers and pick up one of them
$ gh pr merge 123 # Type a PR number which could go wrong by typo
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome

