File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1212 permissions :
1313 contents : read
1414 packages : write
15+ security-events : write
1516
1617 steps :
1718 - name : Checkout
4142 username : ${{ github.actor }}
4243 password : ${{ secrets.GITHUB_TOKEN }}
4344
45+ - name : Build image for scanning
46+ uses : docker/build-push-action@v6
47+ with :
48+ context : docker
49+ load : true
50+ tags : ghcr.io/${{ github.repository }}:scan
51+
52+ - name : Scan image with Trivy
53+ id : trivy-scan
54+ uses : aquasecurity/trivy-action@master
55+ with :
56+ image-ref : ghcr.io/${{ github.repository }}:scan
57+ format : sarif
58+ output : trivy-results.sarif
59+ severity : CRITICAL,HIGH
60+ exit-code : ' 1'
61+
62+ - name : Upload Trivy scan results to GitHub Security
63+ uses : github/codeql-action/upload-sarif@v3
64+ if : always() && steps.trivy-scan.conclusion != 'skipped'
65+ with :
66+ sarif_file : trivy-results.sarif
67+
4468 - name : Build and push
4569 uses : docker/build-push-action@v6
4670 with :
You can’t perform that action at this time.
0 commit comments