diff --git a/vars/sonarExecuteScan.groovy b/vars/sonarExecuteScan.groovy index 965c8c5b6..021d7e5f3 100644 --- a/vars/sonarExecuteScan.groovy +++ b/vars/sonarExecuteScan.groovy @@ -49,6 +49,11 @@ import java.nio.charset.StandardCharsets 'verbose' ] @Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS.plus([ + /** + * Non-Pull-Request voting only: + * Name of the SonarQube branch that should be used to report findings to. If empty, SonarQube uses its main branch per default. + */ + 'branchName', /** * List containing download links of custom TLS certificates. This is required to ensure trusted connections to instances with custom certificates. */ @@ -190,6 +195,8 @@ void call(Map parameters = [:]) { workerForGithubAuth(config) } } + } else { + if(configuration.branchName) configuration.options.add("sonar.branch.name=${configuration.branchName}") } dockerExecute(