From 166a68e4c06e471615c7436b514ccd988a218d00 Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Fri, 24 Jan 2025 11:38:13 +0100 Subject: [PATCH] :bug: [Sonar] Disabled Sonar Scan for PR due SONAR_TOKEN not available for forks Signed-off-by: Alberto Codutti --- .github/workflows/sonarCloud-scan.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sonarCloud-scan.yaml b/.github/workflows/sonarCloud-scan.yaml index 27dd2c44235..51979fa54e4 100644 --- a/.github/workflows/sonarCloud-scan.yaml +++ b/.github/workflows/sonarCloud-scan.yaml @@ -8,6 +8,9 @@ on: branches: - 'develop' +env: + SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }} + jobs: build: name: Analyze @@ -32,8 +35,13 @@ jobs: key: ${{ runner.os }}-sonar - name: Build and analyze + if: ${{ env.SONAR_TOKEN_AVAILABLE == 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B compile -PsonarScan + - name: Skip Build and analyze + if: ${{ env.SONAR_TOKEN_AVAILABLE == 'false' }} + run: echo "Secret SONAR_TOKEN not available to this workflow run... Skipping analysis!" +