I am on teams plan and cannot see feature branch getting scanned

Hi here,

I am using Sonarcloud teams plan and have integrated it with Dotnet Projects. SonarCloud is only scanning the master/main branch and not the featured/short-lived branch.

We have created one bash sonarcloud.sh file pasted below and called it in build yaml file on build_success condition.

====================================
sonarcloud.sh

export SONAR_SCANNER_VERSION=5.0.1.3006
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"

#Execution
sonar-scanner \
  -Dsonar.organization=<<Organization Name>>\
  -Dsonar.projectKey=<<Project Name>>\
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sonarcloud.io 

========================================
I am using appveyor tool for CI and Bitbucket as Version Control System.

Hey there.

You’ll need to manually set sonar.branch.name in your pipeline.

There’s usually an environment variable you can use to make this happen dynamically. For Appveyor that looks like APPVEYOR_REPO_BRANCH!

Hi Colin,

Thanks for the assistance. Although we were able to resolve this issue by ourself only, but appreciate the efforts