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.