diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c722df2..1de2c9e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -107,11 +107,14 @@ jobs: contents: read security-events: write steps: + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - name: Restore cached trivy DBs uses: actions/cache/restore@v4 with: path: ${{ github.workspace }}/.cache/trivy - key: cache-trivy + key: cache-trivy-${{ steps.date.outputs.date }} - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 214c7fa..9ba6d25 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -14,6 +14,10 @@ jobs: - name: Setup oras uses: oras-project/setup-oras@v1 + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + - name: Download and extract the vulnerability DB run: | mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db @@ -32,4 +36,4 @@ jobs: uses: actions/cache/save@v4 with: path: ${{ github.workspace }}/.cache/trivy - key: cache-trivy + key: cache-trivy-${{ steps.date.outputs.date }}