From 2fa350cc6af9a5d6d0080f784813505c3c828b09 Mon Sep 17 00:00:00 2001 From: mamutmk5 <3045922+mamutmk5@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:29:10 +0100 Subject: [PATCH] BC-8372 - fix cache nameing --- .github/workflows/push.yml | 5 ++++- .github/workflows/trivy.yml | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 85fe8c3bfdc..333d4afe59d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -171,11 +171,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: run trivy vulnerability scanner uses: aquasecurity/trivy-action@1f6384b6ceecbbc6673526f865b818a2a06b07c9 with: diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 214c7fa078e..9ba6d25b268 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 }}