-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
save grype db cache on updates to avoid using stale cache db (#147)
- Loading branch information
1 parent
a213265
commit 7886e65
Showing
1 changed file
with
7 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,11 +121,11 @@ runs: | |
- name: Download Grype | ||
uses: anchore/scan-action/[email protected] | ||
|
||
# Check for any existing cache to reuse / update | ||
- name: Cache Grype DB | ||
id: cache_grype_db | ||
# Check for any existing cache to reuse | ||
- name: Restore Grype DB Cache | ||
id: restore_grype_db | ||
if: ${{ inputs.force_grype_db_update != 'true' }} | ||
uses: actions/cache@v4 | ||
uses: actions/cache/restore@v4 | ||
env: | ||
cache-name: cache_grype_db | ||
with: | ||
|
@@ -139,7 +139,6 @@ runs: | |
|
||
## Edgecase: Grype DB will never update if stale cache is found | ||
- name: Grype DB Check Updates | ||
#if: ${{ steps.cache_grype_db.outputs.cache-hit != 'true' }} | ||
id: grype_db_check_updates | ||
shell: bash | ||
run: | | ||
|
@@ -178,10 +177,10 @@ runs: | |
GRYPE_DB_UPDATE_DOWNLOAD_TIMEOUT: 600s # timeout for actual db download if needed | ||
FORCE_GRYPE_DB_UPDATE: ${{ inputs.force_grype_db_update }} | ||
|
||
- name: Cache Grype DB updates | ||
- name: Update Cache / Save Grype DB updates | ||
if: ${{ steps.grype_db_check_updates.outputs.GRYPE_DB_UPDATE_STATUS == 0 }} | ||
id: cache_grype_db_updates | ||
uses: actions/cache@v4 | ||
id: save_grype_db_cache_updates | ||
uses: actions/cache/save@v4 | ||
env: | ||
cache-name: cache_grype_db # Use generic cache key instead of unique keys for different refs since CVE DB doesn't change frequently | ||
with: | ||
|