You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
We'd need to know how we can put a condition with a PR while merging this to the main branch ; so for some PRs I have 2 successful build required but for some of them I need only one green build ; How can I achieve that flexibility?
Hello @Raktim ,
Welcome to Atlassian Community!
You can configure the merge checks by setting up Branch permissions in your repository, where , among other possible checks, you can define the number of successful builds required before merging to a given branch/branch pattern.
You can get more details about branch permissions in the following documentation:
However, since the merge checks in the branch permissions are configured from the pull request's destination branch perspective, and you mentioned your pull request are both merging to main branch, I'm afraid it would not be possible to configure two different rules for main branch, one requiring 1 successful build and the other 2 successful build, as Bitbucket would not be able to know when to apply one rule or another.
The only way current way to achieve different number of required successful builds would be if you were merging to different branches, so you could have one branch permissions setup for each of the destination branches.
Hope that helps to clarify your questions.
Thank you, @Raktim .
Thanks for clarifying @Patrik S - I understand that @Raktim may have 2 different _source_ branches both merging to main branch. Say we have PRs from bugfix/abc to main require 1 successful build and PRs from feature/xyz require 2 successful builds.
Can you confirm, @Raktim
If that's the use case - Workzone for BB Cloud is an app you can use to define such conditions.
The screenshot doesn't exactly show the number of required builds, but the configs have 2 and 1 required build respectively.
Disclaimer: Izymes just released Workzone Cloud (free) to the MP - let me know if you need any help setting it up.
@Raktim - you can differentiate by specifying the source branch and the destination branch in Workzone settings. The required number of successful build will be checked for every PR from the source to destination branch.
Changing the required number of build dynamically when you create the PR (just like adding reviewers) isn't possible AFAIK.