Commit 149d909 1 parent 38ce380 commit 149d909 Copy full SHA for 149d909
File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 6
6
types :
7
7
- completed
8
8
9
+ env :
10
+ SONAR_ORGANIZATION : ${{ vars.SONAR_ORGANIZATION || github.repository_owner }}
11
+
9
12
jobs :
10
13
retrieve-pr :
11
14
if : github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
@@ -115,14 +118,16 @@ jobs:
115
118
key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
116
119
restore-keys : ${{ runner.os }}-m2
117
120
121
+ # https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-for-maven/
118
122
- name : Build and analyze with SonarCloud
119
123
env :
120
124
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
121
125
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
122
126
run : >
123
127
mvn
124
128
-B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
125
- -Dsonar.projectKey=dogtagpki_jss
129
+ -Dsonar.organization=${SONAR_ORGANIZATION}
130
+ -Dsonar.projectKey=${SONAR_ORGANIZATION}_jss
126
131
-pl '!native,!symkey'
127
132
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
128
133
-Dsonar.pullrequest.key=${{ needs.retrieve-pr.outputs.pr-number }}
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ name: Code Analysis
2
2
3
3
on : [push, pull_request]
4
4
5
+ env :
6
+ SONAR_ORGANIZATION : ${{ vars.SONAR_ORGANIZATION || github.repository_owner }}
7
+
5
8
jobs :
6
9
build :
7
10
if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
@@ -38,14 +41,16 @@ jobs:
38
41
key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
39
42
restore-keys : ${{ runner.os }}-m2
40
43
44
+ # https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-for-maven/
41
45
- name : Build and analyze with SonarCloud
42
46
env :
43
47
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
44
48
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
45
49
run : >
46
50
mvn
47
51
-B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
48
- -Dsonar.projectKey=dogtagpki_jss
52
+ -Dsonar.organization=${SONAR_ORGANIZATION}
53
+ -Dsonar.projectKey=${SONAR_ORGANIZATION}_jss
49
54
-pl '!native,!symkey'
50
55
51
56
get-pr-ref :
Original file line number Diff line number Diff line change 10
10
<packaging >pom</packaging >
11
11
12
12
<properties >
13
- <sonar .organization>dogtagpki</sonar .organization>
14
13
<sonar .host.url>https://sonarcloud.io</sonar .host.url>
15
14
<sonar .c.file.suffixes>-</sonar .c.file.suffixes>
16
15
<sonar .cpp.file.suffixes>-</sonar .cpp.file.suffixes>
You can’t perform that action at this time.
0 commit comments