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!" +