SonarQubePrepare task fail if not on default branch

We are running the SonarQubePrepare task and it is failing when run against a branch other than the default branch.
Using yaml is there a condition for default branch, so that this task will only run if it is the default task?
The alternative is to provide the default branch now like: eq(variables[‘Build.SourceBranch’], ‘refs/heads/main’). But we waver between master, main or develop as our default branch. It would be helpful if the condition was just if it’s the default branch.

Hi @Angela_Kim ,

Welcome to the Sonar Community!

This task should not fail for this reason. Can you add the /d:sonar.verbose=true flag, rerun, zip the pipeline output from the Prepare step in text format and share here so we can take a look.

Can you also share details on what version of Azure DevOps, TFS you are using?