Must-share information (formatted with Markdown):
sonarqube-quality-gate-action@master
(our server runs SonarQube DE 9.9.0.65466), scriptcheck-quality-gate.sh
- GH action is being run in GH runner MacOS 12.6.7
- Goal: Fix bug regarding running action on MacOS
Issue
When running sonarqube-quality-gate-action@master
’s check-quality-gate.sh
on our MacOS GH action, the action fails with the following error:
Run $GITHUB_ACTION_PATH/script/check-quality-gate.sh $GITHUB_REPO/.scannerwork/report-task.txt
$GITHUB_ACTION_PATH/script/check-quality-gate.sh $GITHUB_REPO/.scannerwork/report-task.txt
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
SONAR_TOKEN: ***
SONAR_HOST_URL: ***
usage: sleep seconds
.
Error: Process completed with exit code 1.
After further investigation, this refers to line 42 https://github.com/SonarSource/sonarqube-quality-gate-action/blob/master/script/check-quality-gate.sh, where the command sleep 5s
does not work on MacOS. Rather, MacOS expects the format to be sleep 5
, where the unit is by default seconds.
Thankfully, on a Ubuntu environment, sleep 5
also works.
I’m proposing simply changing line 42 from sleep 5s
→ sleep 5
, which both supports MacOS runners and existing Ubuntu runners
Worth nothing the job still runs the quality gate, but the Action itself fails because of the non-zero exit code.