File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Trivy Image Scan
1+ name : Docker Security Scan
22
33on :
44 push :
55 branches : [master]
66 pull_request :
77 branches : [master]
8- workflow_dispatch :
98
109jobs :
1110 scan :
12- name : Scan Docker Image with Trivy
11+ name : Scan Docker Image with Anchore
1312 runs-on : ubuntu-latest
1413
1514 steps :
2221 - name : Build image
2322 run : docker build -t python-samples-fastapi-restful .
2423
25- - name : Install Trivy manually
26- run : |
27- curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
28-
29- - name : Run Trivy scan
30- run : |
31- trivy image --no-progress --format table -o trivy-report.txt python-samples-fastapi-restful
32-
33- - name : Show Trivy report in logs
34- run : cat trivy-report.txt
35-
36- - name : Upload Trivy report
37- uses : actions/upload-artifact@v4
24+ - name : Run Anchore scan
25+ uses : anchore/scan-action@v2
3826 with :
39- name : trivy-scan-report
40- path : trivy-report.txt
27+ image-reference : python-samples-fastapi-restful
28+ fail-build : true
You can’t perform that action at this time.
0 commit comments