diff --git a/.drone.star b/.drone.star index 8eb9e76a8d..e59576e08f 100644 --- a/.drone.star +++ b/.drone.star @@ -134,6 +134,10 @@ def testing(ctx): 'SONAR_TOKEN': { 'from_secret': 'sonar_token', }, + '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.replace("refs/pull/", "").split("/")[0] if ctx.build.event == 'pull_request' else None, }, }, ], diff --git a/sonar-project.properties b/sonar-project.properties index aede036771..1f5706c353 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -25,9 +25,9 @@ sonar.sources=. # Pull Requests sonar.pullrequest.provider=GitHub sonar.pullrequest.github.repository=owncloud/ocis-thumbnails -sonar.pullrequest.base=${env.DRONE_BRANCH} -sonar.pullrequest.branch=${env.DRONE_SOURCE_BRANCH} -sonar.pullrequest.key=${env.DRONE_PULL_REQUEST} +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: