How to trigger build on master?

I have SonarCloud configured on my repo. It is inspecting PRs just fine. But the SonarCloud dashboard just shows ““master” branch has not been analyzed yet.”, and I cannot see any way to trigger it.

Welcome to the community!

The analysis triggers depend on your configuration. For example, when using Autoscan, the analysis of master is triggered automatically when you push a commit to master on GitHub. Otherwise it’s up to your build scripts to trigger it. It’s really hard to tell without more details.

Can you please share some more details?

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL

If the project is private, I can open a private thread where you can share the project key and URL.

Hi Janos,

Thanks for the response. Here’s your answers:

ALM Used: GitHub
CI system used: Circle CI
Scanner command used: Sorry, I don’t understand this question.
Languages: PHP, Shell

I see you are using Autoscan: in this case we run the scanner for you.

Currently, Autoscan is triggered when a new commit is pushed to the default branch or to a pull request. It seems the last commit on your default branch was in 2018. After you push a new commit to it (or merge a pull request into it), Autoscan will run for it, and then the analysis should appear on the main page of your project on SonarCloud.

I see activity on your master branch, but it’s not the default branch on GitHub. I think our intended behavior is to analyze your default branch instead of master, and never even mention “master”. I’ll investigate and keep you posted.

Hi @Chekote, sorry for getting back to you so late.

Looking at your project now, I see that master was analyzed. We’ve certainly improved a couple things at our side over the past months, it’s possible that some of them helped for your case too. So I suppose the problem is resolved now, let me know if that’s not the case!