From 0c324d36cfaba32cc6325091631529bd4995ef1b Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 8 Nov 2025 19:38:06 +0100 Subject: [PATCH] chore(setup-db): change cache-dir default to runner.temp (#13) Reviewed-on: https://gitea.t000-n.de/t.behrendt/trivy-actions/pulls/13 Reviewed-by: branch-buddy Co-authored-by: Timo Behrendt Co-committed-by: Timo Behrendt --- .gitea/workflows/ci.yaml | 7 ++----- setup-db/action.yaml | 9 +++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index aae5763..a3a4d0a 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -31,10 +31,7 @@ jobs: with: version: v0.66.0 - name: Setup DB + id: setup-db uses: ./setup-db - with: - cache-dir: ${{ runner.temp }}/trivy - name: Run Trivy - env: - TRIVY_CACHE_DIR: ${{ runner.temp }}/trivy - run: trivy fs --skip-db-update . + run: trivy fs --skip-db-update --cache-dir ${{ steps.setup-db.outputs.cache-dir }} . diff --git a/setup-db/action.yaml b/setup-db/action.yaml index 27191bc..d4d99ed 100644 --- a/setup-db/action.yaml +++ b/setup-db/action.yaml @@ -7,9 +7,14 @@ branding: inputs: cache-dir: - description: "Path to the Trivy cache directory (default: ~/.cache/trivy)" + description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)" required: false - default: "~/.cache/trivy" + default: "${{ runner.temp }}/trivy" + +outputs: + cache-dir: + description: "Path to the Trivy cache directory" + value: ${{ inputs.cache-dir }} runs: using: "composite"