diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml index 6211b70ce5..6aa0caecc1 100644 --- a/.github/workflows/canary.yaml +++ b/.github/workflows/canary.yaml @@ -23,12 +23,14 @@ jobs: name: Upload binaries needs: build-binaries # run this job after 'build-binaries' job completes runs-on: ubuntu-latest + env: + CACHE_KEY: ${{ runner.os }}-bins-${{ github.workflow }}-${{ github.sha }} steps: - name: Restore Trivy binaries from cache uses: actions/cache@v4 with: path: dist/ - key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}} + key: ${{ env.CACHE_KEY }} # Upload artifacts - name: Upload artifacts (trivy_Linux-64bit) @@ -57,4 +59,10 @@ jobs: with: name: trivy_macOS-ARM64 path: dist/trivy_*_macOS-ARM64.tar.gz - if-no-files-found: error \ No newline at end of file + if-no-files-found: error + + - name: Delete cache after upload + run: | + gh cache delete "$CACHE_KEY" --confirm + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file