This change enables correctly performing pull request analysis where the base branch is not the repository's default branch. sonar.pullrequest.base is configured based on pull request resource metadata instead of sonar.branch.name.
Previously, sonar.branch.name was used to set sonar.pullrequest.base and both parameters were passed to sonar-scanner. However, sonar.branch.name is incompatible with pull-request analysis resulting in scan failure. Not supplying sonar.pullrequest.base results in using the repository's default branch, which causes warnings and potentially incorrect diffs to be displayed in SonarQube when the base branch is not the repository's default branch.
This change enables correctly performing pull request analysis where the base branch is not the repository's default branch.
sonar.pullrequest.base
is configured based on pull request resource metadata instead ofsonar.branch.name
.Previously,
sonar.branch.name
was used to setsonar.pullrequest.base
and both parameters were passed to sonar-scanner. However,sonar.branch.name
is incompatible with pull-request analysis resulting in scan failure. Not supplyingsonar.pullrequest.base
results in using the repository's default branch, which causes warnings and potentially incorrect diffs to be displayed in SonarQube when the base branch is not the repository's default branch.