Dear Bitbucket Community,
I would want to ask if you have any information about branch restriction where I need 2 approvals for PRs:
- 1 of the approvals must be from "default reviewers"
- 1 of the approvals can be from anyone who can access the repository.
and if there are two approvals, anyone who has access to the repository, to be able to merge or if there aren't enough approvals, only the default reviewers to be able to merge.
The configs which I tried were:
- From: Repository Settings -> Branch restrictions -> Actions (on the desired branch) -> Edit -> Merge Settings -> Minimum number of approvals (2) and Minimum number of approvals from default reviewers (1) , because if one approval is set from default reviewers it will be also counted in "Minimum number of approvals". Also set "Prevent a merge with unresolved merge checks" to prevent merges if the approvals are not enough, but everyone will be able to merge, but in this case, the default reviewers cannot merge without all approvals too. If I set restriction in "Branch Permissions" inside the list "Merge access via pull request", then only the whitelisted users will be able to merge which is not what I need and if "Prevent a merge with unresolved merge checks" is enabled, it will also avoid merge, even if the users are with "Admin" permissions for the repository.
Best Regards,
Elena
Hi Elena,
The closest thing to what you are asking is the following:
The default reviewers will not be able to merge the PR that doesn't have the necessary number of approvals.
However, they will be able to:
If they merge the branches this way with merge strategy Fast forward or Merge commit, then the PR is also going to be marked as merged automatically.
Please keep in mind that if you give the default reviewers write access to the destination branch via the Branch permission, they will be able to merge the branches even when there are zero approvals in the PR and also push to the branch.
Please feel free to reach out if you have any questions!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.