Sonarcloud default branch for analysis is ignoring the branch

I am getting issue with the default branch analysis.
Can anyone help with what could be wrong

Hey there.

You haven’t told us very much about your project – what DevOps Platform are you using (GitHub, Gitlab, etc…) and how is analysis configured for your project?

My project is in Swift and I am using Gitlab ci/cd.
This is how my yml file looks:

variables:
 SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
 GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task

sonarcloud-check:
 image:
   name: sonarsource/sonar-scanner-cli:latest
   entrypoint: [""]
 cache:
   key: "${CI_JOB_NAME}"
   paths:
     - .sonar/cache
 script:
   - sonar-scanner -X
 only:
   - develop
   - merge_requests

Thanks.

What happens when you run this against your develop branch? Do you see analysis being performed in the pipeline, and succeed? If it succeeds, what URL does it point you to at the end of the logs?

It is not running at all for develop.
And I assume which is why I am getting this error.

This is how I have set my repo, could you spot if I am missing anything here:

I don’t think you’ll find the issue in SonarCloud – you’ll need to make sure that the action is running for your develop branch – that’s the only way analysis will be pushed to SonarCloud. Has your YAML actually been merged into your develop branch?

Yes, my yaml is pushed into develop.
I do not actually understand a way to trigger the action specifically for develop branch