Skip to content

Commit

Permalink
Merge pull request #921 from apache/fix/sonar
Browse files Browse the repository at this point in the history
Always run Sonar scan against the master branch
  • Loading branch information
lukaszlenart authored Nov 18, 2024
2 parents 780280a + c009a4a commit b3807b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ jobs:
sonarcloud:
name: Scan
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.base.repo.fork || !github.event.pull_request.head.repo.fork }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21
cache: 'maven'
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: mvn -B -V -Pcoverage -DskipAssembly verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress
if: ${{ github.ref == 'master' || github.base_ref == 'master' }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.branch.name=master -Pcoverage -DskipAssembly

0 comments on commit b3807b1

Please sign in to comment.