How to limit SonarQube scope to certain branches?

We’re using SonarQube 9.2 and would like to limit the scanning only for a few branches. How/where do I specify the branches I’d like to scan?

This is normally handled in the CI tool you’re using to run analysis, where you choose what actions happen in the build based on what branch is being built.

You have to add the line
sonar.branch.name=main
to the project’s sonar-project.properties file.

I haven’t found too much documentation about this, could not figure out how to list multiple branches, but this works, new branches are not going to appear in SonarQube.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.