cta-observatory/ctapipe

Sonarqube setup does not work in PRs from forks

Closed this issue · 3 comments

The CI run fails because the job from your fork doesn't have access to SONAR_TOKEN.

Which is really not good and we should have noticed earlier... how to we proceed here? Convert the SONAR_TOKEN from a secret to a simple env variable? Doesn't seem like a good idea.

Originally posted by @maxnoe in #2573 (comment)

A possible solution is described here:

https://community.sonarsource.com/t/how-to-use-sonarcloud-with-a-forked-repository-on-github/7363/30

The jobs that run in the PR context upload the coverage report as artifact, which triggers a workflow in the main repo that then talks to the sonar qube server.

For some reason the sonar job triggered by the fork does not have branch / or number I formation it seems

Fixed now by a series of trial / error fixes.