From 0a29ff2c57a3a86350351ba7b73d98db3347ab30 Mon Sep 17 00:00:00 2001 From: HenrikB <33327256+littleamigo@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:38:36 +0200 Subject: [PATCH] feat(sonar): report to custom branch name (#1341) * feat(sonar): report to custom branch name * fix typo Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> --- vars/sonarExecuteScan.groovy | 7 +++++++ 1 file changed, 7 insertions(+) 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(