Error in Check Quality Gate Status Github Action

Good Day everyone,

I would like to know how to check the quality gate status from a previous scan in a gitHub workflow. Im using serverVersion= and using the scan with the Msbuild tool (SonarScanner.MSBuild.exe)

In my workflow I was able to checkout my repo, trigger scan, succeed the scan but the part for check the quality Gate always fails.

My github runner its running over a windows server and Im using the official git action to check the quality status from the previous step in the workflow

When it tries to check the quality gate it always fails with this error:

Run sonarsource/sonarqube-quality-gate-action@master

check_suite_focus=true#step:4:6) Error: bash: command not found

It comes to my mind that because Im running the workflow in a windows runner its fails because it cant find the “bash” not sure if the official github actions for checking the quality gate its not mean to be ran in a Windows Servers.

This is the actions im trying to use to check the quality Gate: (GitHub - SonarSource/sonarqube-quality-gate-action)

We use Github Enterprise in our own servers and we have another server for the github runners.

I was able to succeed the scan from the pipeline and the check the report in sonarqube dashboard (sonarqube its in our own server too) but in the step for checking the quality gate that its fails.

Hey there.

Two points:

  • Because SonarSource/sonarqube-scan-action can only run on Linux due to being built on Docker, sonarsource/sonarqube-quality-gate-action is also linux only.
  • If you want to wait for the Quality Gate on a project being analyzed by the Scanner for .NET (Scanner for MSBuild), you can add /d:sonar.qualitygate.wait=true to your analysis parameters
1 Like

Thank you Colin.

It did work,

Do you know if there is any way to fail the pipeline if the quality gate didn’t PASS?

Adding /d:sonar.qualitygate.wait=true will do exactly that!

1 Like