Skip to content

Commit 89dd0a5

Browse files
committed
Run sonar on pull_request_target to ensure it sees secrets
1 parent 4ba2191 commit 89dd0a5

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

.github/workflows/basic-checks.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,3 @@ jobs:
3131
- uses: actions/checkout@v2
3232
- name: Check
3333
run: ./gradlew test
34-
35-
sonar:
36-
name: Build
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v2
40-
with:
41-
# Shallow clones should be disabled for a better relevancy of analysis
42-
fetch-depth: 0
43-
- name: Set up JDK
44-
uses: actions/setup-java@v1
45-
with:
46-
java-version: ${{ env.JAVA_VERSION }}
47-
- name: Cache SonarCloud packages
48-
uses: actions/cache@v1
49-
with:
50-
path: ~/.sonar/cache
51-
key: ${{ runner.os }}-sonar
52-
restore-keys: ${{ runner.os }}-sonar
53-
- name: Cache Gradle packages
54-
uses: actions/cache@v1
55-
with:
56-
path: ~/.gradle/caches
57-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
58-
restore-keys: ${{ runner.os }}-gradle
59-
- name: Build and analyze
60-
env:
61-
# Needed to get PR information, if any
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
# Sonar login token with 'Execute Analysis' privileges
64-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65-
run: ./gradlew build sonarqube --info
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeQL
1+
name: Code Analysis
22

33
on:
44
push:
@@ -64,3 +64,35 @@ jobs:
6464
6565
- name: Perform CodeQL Analysis
6666
uses: github/codeql-action/analyze@v1
67+
68+
sonar:
69+
name: Sonarqube
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v2
73+
with:
74+
# Shallow clones should be disabled for a better relevancy of analysis
75+
fetch-depth: 0
76+
- name: Set up JDK
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: ${{ env.JAVA_VERSION }}
80+
- name: Cache SonarCloud packages
81+
uses: actions/cache@v1
82+
with:
83+
path: ~/.sonar/cache
84+
key: ${{ runner.os }}-sonar
85+
restore-keys: ${{ runner.os }}-sonar
86+
- name: Cache Gradle packages
87+
uses: actions/cache@v1
88+
with:
89+
path: ~/.gradle/caches
90+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
91+
restore-keys: ${{ runner.os }}-gradle
92+
- name: Build and analyze
93+
env:
94+
# Needed to get PR information, if any
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
# Sonar login token with 'Execute Analysis' privileges
97+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
98+
run: ./gradlew build sonarqube --info

0 commit comments

Comments
 (0)