Skip to content

Commit acd077c

Browse files
committed
fix(ci): use oci-archive format for trivy scan and cache vulndb
The image was built and saved as an OCI archive (via buildah push oci-archive:...) but trivy was invoked with --input which only accepts Docker-format tars. Switch to the oci-archive: image reference so trivy correctly parses the OCI layout. Also add a GitHub Actions cache step for ~/.cache/trivy so the 85 MiB vulnerability DB is not re-downloaded on every release run. https://claude.ai/code/session_01FovhL9GqcEehmbUDtPyt5Z
1 parent 6489460 commit acd077c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.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)