I am getting error “Could not find a default branch to fall back on” when i try to run sonarqube command through github actions. Project doesn’t exist on sonarcloud.
If i manually create project, everything gonna work fine.
Any advice here?
Thanks
ALM: Github
CI system used: Github Actions
Scanner command used: ./gradlew project-name:sonarqube -Dsonar.login=hidden
Languages of the repository: Java
Error observed: Could not find a default branch to fall back on
Thanks for the answer. Unfortunatelly, no.
I am trying to create my projects automatically. My repo is multi-project, contain many microservices applications. It’s java, and we use gradle to build it.
Part of build.gradle.kts file:
In case when project doesn’t exist on SonarCloud pipeline will fail with message: Could not find a default branch to fall back on
If we manually create project on SonarCloud pipeline will finish without any error.
Could you please give the logs produced by the Scanner during its execution, in debug mode?
To enable debug, you can add the option --debug in the gradle ...:sonarqube command line.
Sadly, today we do not support the automatic creation of projects from GitHub Actions. As you noticed, you have to import them on SonarCloud from your DevOps platform first (documentation). It will also create them bound to the DevOps platform, enabling for example the pull/merge request decoration feature.
The error is misleading, I’ll open an internal ticket to make it easier to understand.
We understand that for a large organization, importing all the projects can be a cumbersome operation. May I suggest you add your vote to this card? It is a candidate for our development roadmap, and having votes from users helps us prioritize the future features.