Skip to content

Take the merge button configuration into consideration while merging using the cli #2954

@TomerFi

Description

@TomerFi

Describe the feature or problem you’d like to solve

I'm using:

gh version 1.5.0 (2021-01-21)
https://github.com/cli/cli/releases/tag/v1.5.0

I think it will be a good feature to make the cli take the repository configuration under consideration.
For instance, the Merge button configuration, the following configuration:

image

Will prevent merging commits in the UI,
but if one were to merge using the cli,
then this configuration is ignored.

Today, I had a typo while working with cli:
(extra space between the pr number and the squash parameter)

gh pr merge 22  --squash

That caused the pr to be merged without being squashed first.

Proposed solution

My expectation was for an error message to be displayed,
letting me know that merging commits is disallowed.

Fixing it required me to fetch, pull, amend and force push the repository.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLImore-info-neededMore info needed from user/contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions