Skip to content

🐛 [Sonar] Disabled Sonar Scan for PR/Branches from forks due to missing SONAR_TOKEN not available for forks #1100

🐛 [Sonar] Disabled Sonar Scan for PR/Branches from forks due to missing SONAR_TOKEN not available for forks

🐛 [Sonar] Disabled Sonar Scan for PR/Branches from forks due to missing SONAR_TOKEN not available for forks #1100

name: Sonar Scan
on:
push:
branches:
- 'develop'
pull_request:
branches:
- 'develop'
env:
SONAR_TOKEN_EXISTS: ${{ secrets.SONAR_TOKEN }} != ""
jobs:
build:
if: ${{ $SONAR_TOKEN_EXISTS != 'true' }}

Check failure on line 16 in .github/workflows/sonarCloud-scan.yaml

View workflow run for this annotation

GitHub Actions / Sonar Scan

Invalid workflow file

The workflow is not valid. .github/workflows/sonarCloud-scan.yaml (Line: 16, Col: 9): Unexpected symbol: '$SONAR_TOKEN_EXISTS'. Located at position 1 within expression: $SONAR_TOKEN_EXISTS != 'true'
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository # Checks out a copy of the repository on the runner
uses: actions/checkout@v4
- name: Set up runner
uses: ./.github/actions/setUpRunner
- name: Set up Maven caches
uses: ./.github/actions/setUpMavenCaches
with:
kapua-artifact-cache-enabled: 'false'
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B compile -PsonarScan