Github Actions Error: Could not find a default branch to fall back on

  • Github
  • Github Actions
  • Scanner command - Run sonarsource/sonarcloud-github-action@master
  • Languages - Vue JS, Vanilla JS, HTML, CSS.

I have 4 branches dev, qa, staging and master. Staging is currently used for the live site. Qa is the branch that has a sonar cloud scan on before opening a pull request from qa into staging which also has a scan on. Master is marked the main branch in both GitHub and sonar cloud.

This has been completely fine and working for some time now, but now running the git hub actions so sonar cloud along side a build in qa the scan fails after a minute and has an execution failure and error message of ERROR: Could not find a default branch to fall back on..

Could someone please shed some light on why this might now be happening when previously it was working fine and yaml files have not been changed or edited?

Many thanks


Welcome to the community!

I’ll admit, this was a new one on me, so I did a search on the error message & found several threads [1], [2], [3] that indicate it’s a problem with your project key and/or organization. Basically, it’s a question of properly identifying the project to be analyzed.