Sonarqube Scanner - Github Actions Integration: sonar-project.properties don't get picked up

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension):

sonarqube:9.9.0.65466-developer

  • how is SonarQube deployed: zip, Docker, Helm

SonarQube is deployed on gke via argocd

  • what are you trying to achieve

Run sonar-scan through github actions using the official SonarQujbe Scan Actions.
(Official SonarQube Scan · Actions · GitHub Marketplace · GitHub)

  • what have you tried so far to achieve this

Followed the guideline and setup the workflow file and sonar-project.properties file.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

The workflow is not picking up the sonar-project.properties file and is spitting out the following log.

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE

And if I manually provide the arguments like so:

    args: >
       -Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }}
       -Dsonar.projectBaseDir=/github/workspace
       -Dproject.settings=./sonar-project.properties
       -Dsonar.scm.exclusions.disabled=true

The files don’t get indexed:

INFO: Project configuration:
INFO: 0 files indexed

Any advice on this?

Thanks in advance.

What kind of files are you trying to analyze?

And, most of the time, you shouldn’t need to include these parameters.

   -Dsonar.projectBaseDir=/github/workspace
   -Dproject.settings=./sonar-project.properties

Thank you for the reply.

Currently, the problem seems to be that the SonarQube Scanner Action is not mounting the volumes from the github runner (self-hosted, and which is another docker container running on kubernetes) correctly.

Was there any similar cases like this?