Hi Sonar Community,
I am trying to pass referenceBranch as input to sonar analysis parameter because i want to define new code based on this as we have different target branches in our repo and i want to compare the diff based on target branch where PR is raised. In Sonar UI , new code definitions has been set based on a branch with name “development” but i want to overwrite this from analysis parameter.
Seems like this feature is not working for me, even though I provide these parameters from command line sonar always compares based on development, attaching screenshot as reference.
Source code is present in Github and sonar is running scan from cake script for C#.
Sonar version : * Enterprise Edition
- Version 9.9.1 (build 69595)
script: sonarSettings.ArgumentCustomization = args => args
.Append($"/d:sonar.branch.name={branchName}")
.Append($"/d:sonar.newCode.referenceBranch=main");