mergeable icon indicating copy to clipboard operation
mergeable copied to clipboard

How to disable merge button when checks failed

Open nipundavidnagarro opened this issue 2 years ago • 3 comments

Hi, I created a config file with must_exclude labels and when i created a pull request it showed that checks have failed which is fine as that's what I wanted.

but I was still able to merge the code. Is there a way to disable this button "merge pull request" until all the checks are passed.

image

regards, Nipun David

nipundavidnagarro avatar Jan 24 '23 12:01 nipundavidnagarro

In branch protection of your repo, you need to add Mergeable to the list for required status checks:

image

jusx avatar Jan 25 '23 06:01 jusx

In branch protection of your repo, you need to add Mergeable to the list for required status checks:

image

hey @jusx thanks...for a quick response...

one followup..what should be the branch name pattern...

image

I can see a few suggestions on stack overflow though...but I want all the pull requests to follow this rule...

nipundavidnagarro avatar Jan 25 '23 07:01 nipundavidnagarro

@nipundavidnagarro The branch name pattern depends on your repository and workflow. By default Github will use main as the default branch and if all your PRs are created to merge into main -- then you'd use that as the name pattern.

jusx avatar Jan 28 '23 18:01 jusx