File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,17 @@ jobs:
4141 ${{ runner.os }}-maven-
4242 - name : Cache SonarCloud packages
4343 uses : actions/cache@v2.1.3
44- if : matrix.java_version == '11'
44+ if : ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
45+ env :
46+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
4547 with :
4648 path : ~/.sonar/cache
4749 key : ${{ runner.os }}-sonar
4850 restore-keys : ${{ runner.os }}-sonar
4951 - name : Run tests
5052 run : ./mvnw -V -B -ntp -ff verify jacoco:report
5153 - name : Static Analysis (Sonar)
52- if : matrix.java_version == '11'
54+ if : ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
5355 env :
5456 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5557 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change @@ -34,15 +34,17 @@ jobs:
3434 ${{ runner.os }}-maven-
3535 - name : Cache SonarCloud packages
3636 uses : actions/cache@v2.1.3
37- if : matrix.java_version == '11'
37+ if : ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
38+ env :
39+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
3840 with :
3941 path : ~/.sonar/cache
4042 key : ${{ runner.os }}-sonar
4143 restore-keys : ${{ runner.os }}-sonar
4244 - name : Run tests
4345 run : ./mvnw -V -B -ntp -ff verify
4446 - name : Static Analysis (Sonar)
45- if : matrix.java_version == '11'
47+ if : ${{ env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' && matrix.java_version == '11' }}
4648 env :
4749 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4850 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
You can’t perform that action at this time.
0 commit comments