When running sonar-scanner in github actions merge checks, it correctly detects the branch and only reports issues from that branch, but when when the same PR is sent to the github merge queue, when we invoke the sonar-scanner the report is showing it as the main branch for the git repository.
Do we need to manually specify the branch in order for this to work in the github merge queue? It seems related to how for builds for a github merge queue can be grouped together and a temporary branch is created.
Does sonar-scanner/sonarcloud properly work for github merge queue?
I guess you found an unsupported case where our software doesn’t detect the real branch appropriately when in the merge queue. I’ll dig further into it.
As a workaround, and with a limited knowledge of the GitHub merge queue at the moment, could you try specifying the parameters manually?
If you are analyzing a pull request, the parameter is: -Dsonar.pullrequest.key=1234
If it is a regular branch, then it is: -Dsonar.branch.name=my/cool/branch
Hi, there was any progress about this? I’ve just faced the same issue. It seems it fails to pick up the branch name and reports it incorrectly to the default branch, also incorrectly picking a diff from it, instead the base from the branch protection
Sadly, no progress so far - we are working on our roadmap, and there are already many things in it!
We have taken good note of your interest in that feature though.
If you wish, you can have a look at our roadmap and also submit ideas and vote here: SonarCloud Roadmap