How can I prevent merges from specific branches like 'hotfixes*' in GitHub?"

“In our organization, despite quality gates failing in our repositories, merges to the main branch are still permitted. We require a setup where failing quality gates restrict or block merges for all upcoming branches, except those starting with ‘hotfix-*’. How can we configure this setup to enforce such conditions?”


Welcome to the community!

You haven’t provided any details about your CI, so it’s hard to give specifics. In general, yes you can fail the pipeline when the Quality Gate fails. But no, there’s no mechanism on our side to be choosy about when that kicks in. You’ll have to handle on your side when to block the pipeline and when to let it run, regardless.