mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 07:40:48 -08:00
ci: delete cache after artifacts upload in canary workflow (#9177)
This commit is contained in:
12
.github/workflows/canary.yaml
vendored
12
.github/workflows/canary.yaml
vendored
@@ -23,12 +23,14 @@ jobs:
|
|||||||
name: Upload binaries
|
name: Upload binaries
|
||||||
needs: build-binaries # run this job after 'build-binaries' job completes
|
needs: build-binaries # run this job after 'build-binaries' job completes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CACHE_KEY: ${{ runner.os }}-bins-${{ github.workflow }}-${{ github.sha }}
|
||||||
steps:
|
steps:
|
||||||
- name: Restore Trivy binaries from cache
|
- name: Restore Trivy binaries from cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: dist/
|
path: dist/
|
||||||
key: ${{ runner.os }}-bins-${{github.workflow}}-${{github.sha}}
|
key: ${{ env.CACHE_KEY }}
|
||||||
|
|
||||||
# Upload artifacts
|
# Upload artifacts
|
||||||
- name: Upload artifacts (trivy_Linux-64bit)
|
- name: Upload artifacts (trivy_Linux-64bit)
|
||||||
@@ -57,4 +59,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: trivy_macOS-ARM64
|
name: trivy_macOS-ARM64
|
||||||
path: dist/trivy_*_macOS-ARM64.tar.gz
|
path: dist/trivy_*_macOS-ARM64.tar.gz
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Delete cache after upload
|
||||||
|
run: |
|
||||||
|
gh cache delete "$CACHE_KEY" --confirm
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
Reference in New Issue
Block a user