Skip to content

Commit 12e7cab

Browse files
authored
Run Sonar scan before Grype (#26)
1 parent 9163164 commit 12e7cab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ jobs:
5353
with:
5454
report_paths: '**/target/surefire-reports/TEST-*.xml'
5555

56+
- name: Sonar
57+
if: github.event.pull_request.head.repo.fork == false
58+
run: mvn verify sonar:sonar
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
62+
5663
- name: Grype source code
5764
id: grype_source_code
5865
uses: anchore/scan-action@v6
@@ -69,13 +76,6 @@ jobs:
6976
sarif_file: ${{ steps.grype_source_code.outputs.sarif }}
7077
category: 'source-code'
7178

72-
- name: Sonar
73-
if: github.event.pull_request.head.repo.fork == false
74-
run: mvn verify sonar:sonar
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
78-
7979
- name: Docker
8080
if: github.ref == 'refs/heads/main'
8181
run: mvn -B -DskipTests package jib:build -Djib.to.auth.username=$DOCKER_USER -Djib.to.auth.password=$DOCKER_TOKEN

0 commit comments

Comments
 (0)