Skip to content

Commit 014fac2

Browse files
Merge pull request #4 from DeerHide/claude/update-vulndb-fSV7t
Optimize Trivy vulnerability scanning with caching and OCI archive
2 parents 6489460 + acd077c commit 014fac2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,22 @@ jobs:
101101
IMAGE_NAME: ${{ steps.manifest.outputs.image_name }}
102102
run: dive --ci --source=docker "${IMAGE_NAME}:${IMAGE_VERSION}"
103103

104+
- name: Cache Trivy vulnerability DB
105+
uses: actions/cache@v4
106+
with:
107+
path: ~/.cache/trivy
108+
key: trivy-db-${{ runner.os }}-${{ github.run_id }}
109+
restore-keys: |
110+
trivy-db-${{ runner.os }}-
111+
104112
- name: Trivy vulnerability scan
105113
env:
106114
IMAGE_NAME: ${{ steps.manifest.outputs.image_name }}
107115
run: |
108116
trivy image \
109-
--input "build/${IMAGE_NAME}.tar" \
110117
--severity HIGH,CRITICAL \
111-
--exit-code 1
118+
--exit-code 1 \
119+
"oci-archive:build/${IMAGE_NAME}.tar"
112120
113121
- name: Login to GHCR
114122
env:

0 commit comments

Comments
 (0)