File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -53,27 +53,34 @@ jobs:
53
53
name : Sonar analysis
54
54
needs : validation
55
55
runs-on : ubuntu-latest
56
+ env :
57
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
56
58
steps :
57
59
- uses : actions/checkout@v2
60
+ if : env.SONAR_TOKEN != null
58
61
with :
59
62
fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
60
63
- name : Set up JDK 11
64
+ if : success()
61
65
uses : actions/setup-java@v1
62
66
with :
63
67
java-version : 11
64
68
- name : Cache SonarCloud packages
69
+ if : success()
65
70
uses : actions/cache@v1
66
71
with :
67
72
path : ~/.sonar/cache
68
73
key : ${{ runner.os }}-sonar
69
74
restore-keys : ${{ runner.os }}-sonar
70
75
- name : Cache Gradle packages
76
+ if : success()
71
77
uses : actions/cache@v1
72
78
with :
73
79
path : ~/.gradle/caches
74
80
key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
75
81
restore-keys : ${{ runner.os }}-gradle
76
82
- name : Build and analyze
83
+ if : success()
77
84
env :
78
85
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
79
86
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
You can’t perform that action at this time.
0 commit comments