Skip to content

Commit e7d7b31

Browse files
authored
Update cicd.yml
1 parent 6330ab8 commit e7d7b31

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

.github/workflows/cicd.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,10 @@ jobs:
1010
- name: Build Docker image
1111
run: |
1212
docker build -t my-docker-repo .
13-
- name: Login to Docker Hub
14-
uses: docker/login-action@v3
13+
- name: Run Trivy Scan
14+
uses: aquasecurity/trivy-action@master
1515
with:
16-
username: ${{ secrets.DOCKERHUB_USERNAME }}
17-
password: ${{ secrets.DOCKERHUB_TOKEN }}
18-
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v3
20-
- name: Build and push
21-
uses: docker/build-push-action@v5
22-
with:
23-
context: .
24-
file: ./Dockerfile
25-
push: true
26-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/pythonapp:latest
16+
image-ref: 'my-docker-repo:latest'
17+
format: 'table'
18+
exit-code: 1 # Fails the build if vulnerabilities are found
19+
severity: 'CRITICAL,HIGH'

0 commit comments

Comments
 (0)