Slash in branch name results in wrong Github pull request decoration

When SonarQube runs analysis and updates GitHub check status, it does this for a specific source control revision (commit), and this process works for both individual branches as well as pull requests.

If the same commit appears across multiple branches, including within a pull request, GitHub will display the check status for each location where that commit is present. This behavior comes directly from GitHub’s design and isn’t something SonarQube can control. Consequently, you might see a branch shown on a PR if the analyzed revision exists both on the branch and within the pull request.

In your situation, it’s likely that the wrong sonar.scm.revision is being sent, possibly during the scan of your main branch—which could explain why the PR is being decorated in this way.

Additionally, note that Jenkins configurations can be tricky in this context. Read more here.

For those using Jenkins, this issue should be resolved with the GitHub Branch Source Plugin. Are you utilizing this plugin in your setup?