Skip to content

Commit

Permalink
Merge pull request #4180 from Coduz/fix-disableSonarScanForForks
Browse files Browse the repository at this point in the history
πŸ› [Sonar] Disabled Sonar Scan for PR/Branches from forks due to missing SONAR_TOKEN not available for forks
  • Loading branch information
Coduz authored Jan 27, 2025
2 parents 4a6c79b + 63d3bda commit 2c5f15f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/sonarCloud-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- 'develop'

env:
SONAR_TOKEN_AVAILABLE: ${{ secrets.SONAR_TOKEN != '' }}

jobs:
build:
name: Analyze
Expand All @@ -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!"

0 comments on commit 2c5f15f

Please sign in to comment.