It’s possible to prevent merge of PR in BitbucketCloud when the Quality Gate of SonarCloud is red.
To do that you need:
- To have imported a BitBucketCloud repository into SonarCloud and configured a CI to launch analysis on PR.
- A Premium plan on the BitbucketCloud team
Once you have that, you can configure the branching permission of your repository in BitbucketCloud by adding a check on successful builds and no failed builds and check the condition to prevent a merge with unresolved merge checks.
That’s it! If SonarCloud Quality Gate fails on your PR, you will see something like this: