Github Actions and CI Analysis not working

We are trying to setup our SonarCloud CI analysis but impossible. I am following the Github Action configuration:

  1. generated a token
  2. added the token to the repository secrets
  3. added the build workflow
  4. created the files with the correct information

This is the result of the workflow running on the develop branch:

INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:35.280s
ERROR: Error during SonarScanner execution
INFO: Final Memory: 22M/80M
INFO: ------------------------------------------------------------------------
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

When I enable the debugging I receive this:

06:54:05.918 DEBUG: POST 404[OBFUSCATED]&projectKey=[OBFUSCATED]&characteristic=branch%3Ddevelop&characteristic=branchType%3DLONG | time=3411ms

I tried to give the GITHUB_TOKEN all permissions, didn’t change anything.

What else can I try?

Should I be the owner of the SonarCloud project?
Should I add more permissions somewhere?
Should we have a paid Github plan like Team or Enterprise?

In the SonarCloud App, I can’t seem to save the change, not sure if that’s normal:

Details of the project:

  • GitHub
  • GitHub Actions
  • Nx Monorepo with Typescript
  • Private repository

Just to answer my own question. It looks like if one is not Admin in the SonarCloud organization, they can’t run the analysis on Github.


In case it helps, you don’t necessarily need to be an admin in SonarCloud, you just need to have analysis rights, which is a separate, granular permission.