This action fails with the following error message :
Run ${GITHUB_ACTION_PATH}/scripts/create_install_path.sh
${GITHUB_ACTION_PATH}/scripts/create_install_path.sh
shell: C:\Windows\system32\bash.EXE --noprofile --norc -e -o pipefail {0}
env:
SONAR_HOST_URL: https://sonarcloud.io
INSTALL_PATH: .sonar
Running WSL as local system is not supported.
Error code: Bash/WSL_E_LOCAL_SYSTEM_NOT_SUPPORTED
Is it an expected limitation? If yes, is there a way to workaround it?
You are asking for details regarding my setup. Here there are:
I am using an Analysis of type CI for my C++/Objective C project (automatic analysis disabled from the SonarCloud web interface)
I am using a Github workflow run by a self-hosted Window 11 CI runner.
The Windows OS version is: Microsoft Windows [version 10.0.22631.4249].
The failure occurs with the Github action SonarSource/sonarcloud-github-c-cpp@v3. The syntax I am using is the syntax suggested in the SonarCloud web interface (Administration > Analyse Method > View Github Actions, " Analyze a project with a GitHub Action")
In a previous step, I installed the Windows Subsystem for Linux (WSL) on my Windows runner because the action failed: the action required the bash command to be installed.
Now that bash is installed on the Windows 11 runner, the error is different: the action fails, informing me that Running WSL as local system is not supported. (Is this message generated by Sonar’s code?)
Would you need something else that would help you help me?
by looking a the GitHub hosted runner image configuration and the run of our example we see that Git bash is used rather than the wsl bash. You can install Git for Windows and add the bash path at first.
Git for Windows and its bash command were already installed on my runner, but the Github actions couldn’t see it without the following addition to my Github workflow:
- name: Load system Path into Github environment
run : echo Path=%Path%>> %GITHUB_ENV%
shell: cmd
Problem solved.
It was not related to SonarCloud scripts, just to my Github Actions setup and my environment variables. My apologies for this.
Your super useful advice has been extremely well appreciated!