From 253cb21f68327f64b46fa71dee4abb02548005e9 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sat, 3 Aug 2024 17:06:04 +0200 Subject: [PATCH] build: only run analysis if tokens are available This allows reuse of the GitHub actions on internal platforms without messing up SonarCloud analysis from different repositories. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2eb7f36..8882342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/') run: mvn -B -P coverage verify - name: Analysis - if: matrix.analysis + if: ${{ matrix.analysis && env.GITHUB_TOKEN != '' && env.SONAR_TOKEN != '' }} run: > mvn -B sonar:sonar -Dsonar.host.url=https://sonarcloud.io