Skip to content

Commit ad08cfb

Browse files
Update .github/workflows/container_image.yaml
Co-authored-by: codiumai-pr-agent-free[bot] <138128286+codiumai-pr-agent-free[bot]@users.noreply.github.com>
1 parent 80f3832 commit ad08cfb

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/container_image.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,29 @@ jobs:
4343
type=sha,format=short,prefix=
4444
type=sha,format=long,prefix=
4545
46-
- name: Build and push Docker image
47-
id: build-and-push
46+
- name: Build Docker image
47+
id: build
4848
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
4949
with:
5050
context: .
51-
push: ${{ github.event_name != 'pull_request' }}
51+
push: false
5252
tags: ${{ steps.meta.outputs.tags }}
5353
labels: ${{ steps.meta.outputs.labels }}
5454
provenance: false
5555
cache-from: type=gha
5656
cache-to: type=gha,mode=max
57+
58+
- name: Scan image for vulnerabilities
59+
uses: aquasecurity/trivy-action@master
60+
with:
61+
image-ref: ${{ steps.meta.outputs.tags }}
62+
format: 'table'
63+
exit-code: '1'
64+
ignore-unfixed: true
65+
vuln-type: 'os,library'
66+
severity: 'CRITICAL,HIGH'
67+
68+
- name: Push Docker image
69+
if: success() && github.event_name != 'pull_request'
70+
run: |
71+
docker push ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)