We are using Sonarcloud and trying to use the Sonarcloud API to create a new project that is referenced to a github repository.
A couple of things are happening:
- The project within sonarcloud is not linked to github
- After the initial scanning (using projectkey) there are two branches master (the main) and main
The problem we are having is our github repository has one branch initially… main
Within Sonarcloud we see:
- Long-lived branches - master
- Short-lived branches - main
Why is this happening? also is “linked” repositories only available for “automatic scanning”? we want to use manual scanning.
Basically I am doing the following:
https://sonarcloud.io/api/projects/create API passing in the following:
We then use
sonar-scanner CLI passing in the following:
How can we make the Long lived branch set to main? or is it always going to be master?
Things seem to be good if we create the project using the Sonarcloud UI… but we cannot use the UI and want to do this programmatically… is this not possible? or am I doing something wrong.