Skip to content

Commit

Permalink
ci: use day for cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Oct 3, 2024
1 parent 209468e commit d9536f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/trivy-action-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

## To avoid the trivy-db becoming outdated, we save the cache for one day
- name: Get data
id: date
run: echo "CACHE_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV

- name: Restore trivy cache
uses: actions/cache@v4
with:
path: cache/db
key: trivy-cache
key: trivy-cache-${{ env.CACHE_DATE }}
restore-keys:
trivy-cache
trivy-cache-

- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@0.24.0
Expand Down

0 comments on commit d9536f1

Please sign in to comment.