diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 70c0404d31e5..45fd2b52c4c3 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -40,7 +40,9 @@ jobs: uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: /home/runner/vuln-cache - key: trivy-latest-cache + key: download-failed # Use a non existing key to fallback to restore-keys + restore-keys: | + trivy-cache- - name: Run Trivy vulnerability scanner run: | @@ -52,12 +54,10 @@ jobs: --output trivy-lxd-repo-scan-results.sarif . - name: Cache Trivy vulnerability database - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: /home/runner/vuln-cache - key: trivy-latest-cache-${{ github.run_id }} - restore-keys: | - trivy-latest-cache + key: trivy-cache-${{ github.run_id }} - name: Upload Trivy scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1 @@ -89,7 +89,9 @@ jobs: uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: /home/runner/vuln-cache - key: trivy-latest-cache + key: download-failed # Use a non existing key to fallback to restore-keys + restore-keys: | + trivy-cache- - name: Download snap for scan run: |