forked from nanotaboada/python-samples-fastapi-restful
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 927 Bytes
/
docker-security.yml
File metadata and controls
37 lines (29 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Trivy Image Scan
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
scan:
name: Scan Docker Image with Trivy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
run: docker build -t python-samples-fastapi-restful .
- name: Install Trivy manually
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- name: Run Trivy scan
run: |
trivy image --no-progress --format table -o trivy-report.txt python-samples-fastapi-restful
- name: Upload Trivy report
uses: actions/upload-artifact@v4
with:
name: trivy-scan-report
path: trivy-report.txt