I have been trying to setup SonarCloud Pull request analysis for a GitHub repos of ours. The pull request analysis seems to work fine with the pull request source branch is in the original repo; but when the pull request is created from a fork it seems to fail with the following error;
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:18.104.22.1686:sonar (default-cli) on project jhonline: Parameter 'sonar.pullrequest.branch' is mandatory for a pull request analysis -> [Help 1]
Below is a GitHub action triggered by a pull request where this failure can be seen;
Also I tried adding the
sonar.pullrequest.branch as the error suggests. Then I get a different error;
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:22.214.171.1246:sonar (default-cli) on project jhonline: You're not authorized to run analysis. Please contact the project administrator. -> [Help 1]
The CI run relevant to adding the
sonar.pullrequest.branch can be found here; https://github.com/jhipster/jhipster-online/runs/965109060
I also saw that there is another thread for gradle which has a similar error; but not sure if this one and that one are the same thing.
Any help on this will be greatly appreciated.