`sonarqube-scanner@^4.0.0` doesn't return non-zero exit code in case of Quality Gate failure

  • SonarQube: Developer Edition v10.5.1 (90531)
  • sonarqube-scanner version: 4.0.0 or 4.0.1
  • Used npm package: sonarqube-scanner - npm

When we run it as

npx sonarqube-scanner@^4.0.0 -Dsonar.qualitygate.wait="true" [....]

we expect non-zero exit code if Quality Gateway finds new issues that must be fixed.

But the actual result: this command always return 0 exit code, and our build never fails.

Please note that sonarqube-scanner@^3.5.0 works as expected and really fails the build, but ^4.0.0 doesn’t.

Hello @maks-rafalko,
Welcome to the community! Thank you for bringing this to our attention. I was able to reproduce the issue and have created a ticket to fix the issue. We will be back once a fix has been released.

https://sonarsource.atlassian.net/browse/SCANNPM-39

2 Likes

by the way, It’s released already and now 4.2.0 correctly returns non-zero code

3 Likes