ERROR: Error during SonarScanner execution You're not authorized to run analysis. Please contact the project administrator

I am analyzing an open source project with it. The user should have access to run an analysis.
However, I still get:

 16:41:10.637 DEBUG: POST 403 | time=1141ms
16:41:10.659 INFO: ------------------------------------------------------------------------
16:41:10.660 INFO: ------------------------------------------------------------------------
16:41:10.660 INFO: Total time: 5:12.867s
16:41:10.725 INFO: Final Memory: 9M/34M

Github Job: code-quality: add sonar source analysis · rttrorg/rttr@5a847b4 · GitHub

PR: code-quality: add sonar source analysis by acki-m · Pull Request #315 · rttrorg/rttr · GitHub

What setting is missing?

Hi @acki , welcome to the community forum.

Thanks for the links to the PR!
I see you are trying to analyze the PR from a fork. This feature is currently not supported for CI-based analysis, only for automatic analysis.
It’s already identified on our side, but not planned (some links to follow the progress are on this other thread). You can also vote on that issue: SonarCloud analyzes external Pull Request - SonarCloud | Product Roadmap


actually the analysis is not running on the fork, here you can see:

No analyze with sonar source action

I also added a check whether the action is running on a fork:

So what should I do now?

Okay no when I create a PR from a branch inside the repo it works, sonar cube could upload the report.
And really zero vulnerabilities? Can’t believe it.

However, can you tell me how I can prevent this specific job running, when I got a PR from a fork?

TBH, I don’t know, this is related to Github workflows and not to SonarSource products, and I never tried that so I can’t help.
I found that forum post that gives solutions to a similar problem, maybe it could help.