Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Enable merge button post at least two Pull request approvals

gaurav kumar October 5, 2021

We need to enable the merge button in bit bucket only when the Pull request from any new branch (other than develop, release or master) to another branch is approved by at least two approvers/reviewers. 

Please assist if we can implement this for a particular project.

 

Thanks

 

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2021

Hi, @gaurav kumar!

Thank you for reaching out to Atlassian Community!

Currently, you can suggest or require checks before a merge. Merge checks allow you to recommend or require specific conditions (like approvals on a Pull Request) on merges for individual branches or branch patterns.

Providing your users with recommended checks to consider before merging is available to everyone. However, enforce merge checks is a Premium feature.

In order to set merge checks, you can follow the next steps:

  • Go to Repository settings > Branch permissions

  • Click Add a branch permission.

  • Select the branch by name or pattern or by type

  • In Write access, add the users and groups who can push or merge any changes to this branch directly

  • In Merge via pull request, add the users and groups who can merge to this branch via pull request

  • And finally, in the Merge checks options, you can select:

    • Check for at least 2 approval

    • Check for at least 2 approval from default reviewers

This way, if someone tries to merge this Pull Request, they will see the following message, but they will still be able to merge the PR: 

Screen Shot 2021-10-06 at 5.30.10 PM.png

To enforce these merge checks (and disable the merge button until they are resolved), you will have to check the "Prevent a merge with unresolved merge checks" setting in the branch permission which is only available on the Premium plan: 

Screen Shot 2021-10-06 at 5.39.27 PM.png

In case you would like to read more about merge checks, you can access the following documentation: 

I hope this information helps, but please feel free to share any additional questions regarding this case.

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events