Stopping build pipeline on a failed Quality Gate for .NET SonarScanner within Bitbucket Pipelines

Hi All,

We are using Bitbucket Pipelines with SonarScanner for .NET (as described in the link below). It’s all working fine, and results are uploaded to SonarCloud where the Quality Gate is indicating failed, as it should. Is there a way using the SonarScanner tool for .NET (or any other way) to stop the build pipeline when the Quality Gate fails?

https://sonarcloud.io/documentation/advanced-setup/ci-based-analysis/sonarscanner-for-dotnet/

I’ve read this is possible using the sonarcloud-scan and sonarcloud-quality-gate pipes, however the scanner doesn’t support .NET.

Any advice on how to achieve this?

Hi @matthewm

Except failing the approvement of a PullRequest, there’s no proper way to do so right now.

All i can think of is to add a step that calls the SonarCloud API and check the QG status for your specific branch/project and raises an error if needed.

HTH,
Mickaël

Thanks Mickaël, no problems.

Is this something planned for the future at all?

Hi @matthewm sorry for the late late answer here.

AFAIK this is not planned for the moment.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.