From 089f377de9426296120dea8f6eb32987527c3580 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Wed, 2 Oct 2024 09:59:32 +0300 Subject: [PATCH] Create the trivy cache dir if it wasn't created because if there is no cache to restore, the directory doesn't get created Signed-off-by: Dimitris Karakasilis --- .github/workflows/release-arm.yaml | 2 ++ .github/workflows/release.yaml | 2 ++ .github/workflows/reusable-build-flavor.yaml | 1 + .github/workflows/reusable-build-provider.yaml | 1 + .github/workflows/reusable-docker-arm-build.yaml | 1 + 5 files changed, 7 insertions(+) diff --git a/.github/workflows/release-arm.yaml b/.github/workflows/release-arm.yaml index 43518201d..1a5f3bc6d 100644 --- a/.github/workflows/release-arm.yaml +++ b/.github/workflows/release-arm.yaml @@ -253,6 +253,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build 🔧 run: | @@ -373,6 +374,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build 🔧 run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ea13f8075..f2038af1c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -167,6 +167,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build 🔧 run: | @@ -421,6 +422,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build 🔧 run: | diff --git a/.github/workflows/reusable-build-flavor.yaml b/.github/workflows/reusable-build-flavor.yaml index 0fe800d16..34f62b342 100644 --- a/.github/workflows/reusable-build-flavor.yaml +++ b/.github/workflows/reusable-build-flavor.yaml @@ -112,6 +112,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build PR 🔧 if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/reusable-build-provider.yaml b/.github/workflows/reusable-build-provider.yaml index e7b6af59c..9d08ca733 100644 --- a/.github/workflows/reusable-build-provider.yaml +++ b/.github/workflows/reusable-build-provider.yaml @@ -96,6 +96,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build PR 🔧 if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/reusable-docker-arm-build.yaml b/.github/workflows/reusable-docker-arm-build.yaml index fc41d840e..c210612da 100644 --- a/.github/workflows/reusable-docker-arm-build.yaml +++ b/.github/workflows/reusable-docker-arm-build.yaml @@ -137,6 +137,7 @@ jobs: gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Populate trivy Cache run: | + [ ! -d ".trivy" ] && mkdir -p ".trivy" earthly +trivy-download-db --DIR .trivy - name: Build 🔧 run: |