Skip to content

Commit 2b0c35a

Browse files
committed
1 parent a0e8252 commit 2b0c35a

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
name: Trivy Image Scan
1+
name: Docker Security Scan
22

33
on:
44
push:
55
branches: [master]
66
pull_request:
77
branches: [master]
8-
workflow_dispatch:
98

109
jobs:
1110
scan:
12-
name: Scan Docker Image with Trivy
11+
name: Scan Docker Image with Anchore
1312
runs-on: ubuntu-latest
1413

1514
steps:
@@ -22,19 +21,8 @@ jobs:
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

0 commit comments

Comments
 (0)