Over night, the sonarsource/sonarcloud-github-action stopped working. It immediately fails with the error:
/entrypoint.sh: line 24: sonar-scanner: command not found
Unfortunately, I do not have two builds of the same commit, since I simply re-run the workflow on GitHub. But I have a workflow run of the PR before and one after the merge, which should be identical code-wise:
(Hint: only the PHP 8.0 on Mosquitto job uses the SonarCloud action)
The virtual environment in which the workflows were executed is identical, according to GitHub. I also tried pinning the sonarsource/sonarcloud-github-action at version v1.4, without luck.
It seems related to a recent change in setup-php action, which introduced a PATH overriding and because of that SonarCloud action fails to find the scanner. You can see at the failing action the big PATH environment introduced.
I would suggest you to try a previous version of setup-php: 2.8.0 (it is from from November 2020, so not that old) to check if it works. Other alternative is to include these in the PATH env for the action: /opt/sonar-scanner and /opt/nodejs.
Hi, did you faced the same issue as @Namoshek? did you check the logs and the PATH value if is correctly configured? Could you share the logs with us, please?
thank you for the quick reply! I think your analysis is on point and I’ve tried to run shivammathur/setup-php@2.8.0 to resolve the issue, but unfortunately with some different issue instead (pcov coverage driver not found anymore). I’ll dive into this a bit more right now and let you know when I find a satisfying solution.