I want to use SonarQube to analyze any pull request (PR) made to my project.
Few quick points:
dev
branch on master
branch);Given these points, this is what I did:
Administration -> Settings -> Pull Requests (Alpha)
, I set the Authentication token
with the bot's token and set the Repository identifier
with my repo address in the <Organization>/<Repo>
format; appveyor.yml
file of my project so to run SonarQube analysis on all PRs; similar to the following: build_script:
choco install "msbuild-sonarqube-runner" -y
MSBuild.SonarQube.Runner.exe begin /k:"REPO" /o:"ORGANIZATION" /d:"sonar.host.url=https://sonarcloud.io" /d:"sonar.analysis.mode=preview"
MSBuild.exe /t:Rebuild
MSBuild.SonarQube.Runner.exe end
However, still I don't see SonarQube using the bot to comment on new PRs (similar to their demo.
The feature you are trying to activate is not ready to be used yet - which is why it is named "Alpha" (Administration -> Settings -> Pull Requests (Alpha)
).
In any case, even when this feature is ready, while this will secure your GitHub token because you will save it on SonarCloud only (which is great), you will still have to provide your SonarCloud token to perform the analysis. And as you don't want to unveil your SonarCloud token, you won't be able to analyze external pull requests. Unfortunately, we currently have no solution to solve this limitation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With