SonarCloud posts branch analysis only in the comment section of Github PR (Pull Request), but it does not show up in Github PR check section. Screenshot showing the issue: Imgur: The magic of the Internet
Steps to reproduce
In Teamcity or local machine,
Sonar scanner is started as such: (Note host url and login is set in config level)
SonarScanner.MSBuild.exe begin /o:"<organization>" /k:"<organization_project>" /d:sonar.pullrequest.key=<pr-id> /d:sonar.pullrequest.branch=<pr-branch> /d:sonar.pullrequest.base="develop" /d:sonar.verbose=true
Solution is compiled using Visual Studio Runner Type in Teamcity or in local as such:
MsBuild.exe /t:Rebuild
Sonar scanner is ended
SonarScanner.MSBuild.exe end
Potential workaround
No workaround known. We need to have SonarCloud hook into Github PR check to use it as our code analysis tool.
Could you please give us the logs produced by the Scanner during its analysis, in debug mode?
That would help us investigate.
If they contain private information, just give me that line of the logs, displayed at the end of the analysis:
Thanks for the link.
The Check decoration got rejected because the SHA of the analyzed commit was not available to SonarCloud. The Check is associated with the commit SHA, not the PR itself.
The commit SHA is read from the Git context (.git directory) by the Sonar Scanner, during analysis.
This directory can be missing, for example if the sources are copied instead of cloned, or not readable.
Could you check your build pipeline for something like that?