File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 build :
4343 needs : prepare
4444 runs-on : ubuntu-latest
45+ permissions :
46+ security-events : write
47+ packages : write
4548 strategy :
4649 matrix : ${{ fromJson(needs.prepare.outputs.matrix) }}
4750 fail-fast : false
9396 echo "tags=${TAGS%,}" >> $GITHUB_OUTPUT
9497
9598 - name : Build and push
99+ id : build
96100 uses : docker/build-push-action@v6
97101 with :
98102 context : .
@@ -106,6 +110,21 @@ jobs:
106110 cache-from : type=gha,scope=${{ matrix.name }}
107111 cache-to : type=gha,mode=max,scope=${{ matrix.name }}
108112
113+ - name : Run Trivy vulnerability scanner
114+ if : steps.build.outcome == 'success'
115+ uses : aquasecurity/trivy-action@master
116+ with :
117+ image-ref : ${{ env.DOCKER_HUB_IMAGE }}:${{ matrix.node_version }}-jdk${{ matrix.jdk_version }}
118+ format : ' sarif'
119+ output : ' trivy-results.sarif'
120+ sevegithub/codeql-action/upload-sarif@v4
121+
122+ - name : Upload Trivy scan results to GitHub Security tab
123+ uses : github/codeql-action/upload-sarif@v3
124+ if : steps.build.outcome == 'success'
125+ with :
126+ sarif_file : ' trivy-results.sarif'
127+
109128 update-readme :
110129 needs : build
111130 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments