diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14323724b..572d8d476 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,8 @@ jobs: java: [ '11', '17', '21', '22', '23' ] os: [ 'ubuntu-24.04', 'macos-14', 'windows-2022' ] runs-on: ${{ matrix.os }} + env: + RUN_SONARQUBE_ANALYSIS: ${{ github.repository == 'focus-shift/jollyday' && matrix.java == 21 && matrix.os == 'ubuntu-24.04' && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,8 +38,8 @@ jobs: - name: Build run: ./mvnw -Pcoverage clean verify - - name: SonarCloud - Analyse - if: ${{ github.repository == 'focus-shift/jollyday' && matrix.java == 21 && matrix.os == 'ubuntu-24.04' && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }} + - name: SonarQube Cloud - Analyse + if: ${{ env.RUN_SONARQUBE_ANALYSIS }} run: > ./mvnw -Pcoverage verify sonar:sonar