When we create a new project on SonarCloud, it defaults to using “master” as the long-lived branch whereas it’s “main” by default on GitHub. This results in an error saying the branch could not be scanned. We have to then manually delete the short-lived “main” branch and rename the “long-lived” master to “main” again.
It is very annoying and not something we can mitigate either from the CLI.
I can see it’s been mentioned in a ticket from 2020 as well.
How are you provisioning the new project? Is it through the UI (where you select a specific repository), or via the CLI (provisioning the project on first analysis)?
It’s pretty annoying that we don’t have a parameter in there to set a branch on project creation.
If you’re already using the API to orchestrate project creation, would it be acceptable to immediately use POST api/project_branches/rename after project creation?