Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Enforce build-required merges to main, but allow controlled emergency hotfix path

Yariv Yarmus
February 23, 2026

Hi,

I’ve configured branch restrictions so that: 

  • main requires pull requests

  • The last commit must have at least 1 successful build

  • Merging with unresolved merge checks is not allowed

 This works well — merges to main are blocked if the build fails.

Now I’m trying to implement an emergency hotfix path with the following behavior:

  1. Normal flow:

    • PR → main

    • Merge blocked if build fails

     

  2. Emergency flow:

    • Create hotfix/* branch

    • Allow controlled merge to main even if the build fails (only for a restricted group, e.g., release managers)

      

What is the recommended approach in Bitbucket Cloud to support this?

1 answer

0 votes
Saxea _Flowie_
Atlassian Partner
February 23, 2026

Hi @Yariv Yarmus

This workflow is currently not supported by branch restrictions out of the box.

We do provide a solution for this kind of workflow via our Bitbucket app Flowie.

You can use rules and conditions along with the merge plugin and the allow option. Your configuration would be something like this: 

configure({
plugins: [
minimumBuilds([source(/hotfix.*/), 0], [otherwise, 1]),
merge(
[source(/hotfix.*/), {allow: ["RELEASE_MANAGERS_GROUP"]}],
[otherwise /* default options */]
),
],
})

Hope it helps!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events