Optimize Trivy vulnerability scanning with caching and OCI archive#4
Merged
miragecentury merged 1 commit intomainfrom Feb 19, 2026
Merged
Optimize Trivy vulnerability scanning with caching and OCI archive#4miragecentury merged 1 commit intomainfrom
miragecentury merged 1 commit intomainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the Trivy vulnerability scanning step in the release workflow by adding caching for the vulnerability database and updating the image input format to use OCI archive syntax.
Key Changes
~/.cache/trivyto avoid re-downloading the vulnerability database on every workflow run, reducing scan time and improving efficiency--inputflag to theoci-archive:URI scheme for specifying the container image source--inputflag and restructured the command to use the modern OCI archive formatImplementation Details
runner.osandgithub.run_idto ensure proper cache isolation per OS and workflow runoci-archive:build/${IMAGE_NAME}.tar) is the recommended approach for scanning local container images with Trivyhttps://claude.ai/code/session_01FovhL9GqcEehmbUDtPyt5Z