From faf4a25e1faf2f0946e37c087fedb1505535468d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20R=C3=A1tkai?= Date: Thu, 20 Apr 2023 16:58:47 +0100 Subject: [PATCH] theoretical solution --- .github/workflows/maven.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index cf4e5889..c07083a5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,12 +28,13 @@ jobs: run: mvn -B verify --file pom.xml - name: Scan with Sonar run: | - if [ $FORK = false ] + if [ $FORK = false ] || [ "$PUSH_REF" = "refs/heads/main" ] then mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BerryCloud_xapi-java -Dsonar.organization=berry-cloud -Dsonar.host.url=https://sonarcloud.io --file pom.xml fi env: FORK: ${{ github.event.pull_request.head.repo.fork }} + PUSH_REF: ${{ github.event.ref }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}