From 7a0f3846bbd5e8123e66767f71aca8019c900139 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 10 Jul 2020 16:42:01 +0200 Subject: [PATCH] read from env, PR id Signed-off-by: Michael Barz --- .drone.star | 3 +-- sonar-project.properties | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.drone.star b/.drone.star index 24da7a04da..e59576e08f 100644 --- a/.drone.star +++ b/.drone.star @@ -134,11 +134,10 @@ def testing(ctx): 'SONAR_TOKEN': { 'from_secret': 'sonar_token', }, - 'SONAR_PULL_REQUEST_PROVIDER': 'GitHub' if ctx.build.event == 'pull_request' else None, 'SONAR_PULL_REQUEST_REPO': 'owncloud/ocis-thumbnails' if ctx.build.event == 'pull_request' else None, 'SONAR_PULL_REQUEST_BASE': 'master' if ctx.build.event == 'pull_request' else None, 'SONAR_PULL_REQUEST_BRANCH': ctx.build.source if ctx.build.event == 'pull_request' else None, - 'SONAR_PULL_REQUEST_KEY': ctx.build.ref if ctx.build.event == 'pull_request' else None, + 'SONAR_PULL_REQUEST_KEY': ctx.build.ref.replace("refs/pull/", "").split("/")[0] if ctx.build.event == 'pull_request' else None, }, }, ], diff --git a/sonar-project.properties b/sonar-project.properties index 05a5d21ff1..1f5706c353 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -23,11 +23,11 @@ sonar.links.issue=https://github.com/owncloud/ocis-thumbnails/issues sonar.sources=. # Pull Requests -sonar.pullrequest.provider=${SONAR_PULL_REQUEST_PROVIDER} -sonar.pullrequest.github.repository=${SONAR_PULL_REQUEST_REPO} -sonar.pullrequest.base=${SONAR_PULL_REQUEST_BASE} -sonar.pullrequest.branch=${SONAR_PULL_REQUEST_BRANCH} -sonar.pullrequest.key=${SONAR_PULL_REQUEST_KEY} +sonar.pullrequest.provider=GitHub +sonar.pullrequest.github.repository=owncloud/ocis-thumbnails +sonar.pullrequest.base=${env.SONAR_PULL_REQUEST_BASE} +sonar.pullrequest.branch=${env.SONAR_PULL_REQUEST_BRANCH} +sonar.pullrequest.key=${env.SONAR_PULL_REQUEST_KEY} # Properties specific to language plugins: