Following the aid I received in Using OpenJDK and newer version of .NET framework with Sonar Scanner, I have set up our TeamCity and Git environment to upload to a repository whenever we do a pull request in Github, using our existing automation in TeamCity. This works well, and our builds are uploaded to SonarCloud and registered, but we are registering an issue.
Our Github setup works with multiple main branches, allowing our developers to work on multiple releases concurrently, or perform bug fixes in older releases to be released with patches.
We would like to be able to see the results of the individual pull requests to our main branches, but all the pull request uploads in SonarCloud are being registered as coming from the same branch, despite being registered correctly in TeamCity. The branch they are registered as coming from are the one that is set as the main Github branch.
This is the sonar-scanner command that we use with sonar-scanner:
sonar-scanner.bat -D"sonar.organization=star-code" -D"sonar.projectKey=STAR-Code_Ydelsesudstilling" -D"sonar.sources=." -D"sonar.host.url=https://sonarcloud.io"
Do I need to change something in the sonar-scanner command, or change anything in my setup in SonarCloud? I have so far only imported the project.