From 2fdd7a11e93c38d0a3496f09232fa10c51de3f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 26 Jul 2020 22:40:42 +0300 Subject: [PATCH] SonarQube check runs only in master branch (workaround for https://jira.sonarsource.com/browse/MMF-1371) --- .github/workflows/maven.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 53460c97d..01caaab67 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -46,7 +46,13 @@ jobs: # Some tests need screen access - name: Install xvfb run: sudo apt-get install xvfb + # SonarQube scan does not work for forked repositories + # See https://jira.sonarsource.com/browse/MMF-1371 - name: Build with Maven + if: github.ref != ‘refs/heads/master’ + run: xvfb-run mvn clean verify + - name: Build with Maven and run SonarQube analysis + if: github.ref == ‘refs/heads/master’ run: xvfb-run mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar env: # These two env variables are needed for sonar analysis