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
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:
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.