Files
sec-actions/setup-db/action.yaml
T
t.behrendt 4b95f85bfd
CI / Test Merge SARIF Files (pull_request) Successful in 3s
CI / Test Setup Trivy amd64 (pull_request) Successful in 5s
CI / Test Get Images From Files (pull_request) Successful in 5s
CI / Test Setup DB (pull_request) Successful in 7s
CI / Test Setup Trivy arm64 (pull_request) Successful in 37s
Revert "refactor(setup-db): to run trivy in docker (#54)"
This reverts commit 81eda53a59.
2026-04-10 19:35:23 +02:00

36 lines
1.0 KiB
YAML

name: "Setup Trivy DB"
description: "Setup the trivy database, restoring from cache if available"
author: "Timo Behrendt <t.behrendt@t00n.de"
branding:
icon: "database"
color: "blue"
inputs:
cache-dir:
description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)"
required: false
default: "${{ runner.temp }}/trivy"
outputs:
cache-dir:
description: "Path to the Trivy cache directory"
value: ${{ inputs.cache-dir }}
runs:
using: "composite"
steps:
- id: current-date
shell: bash
run: |
echo "current-date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- id: restore-db
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ${{ inputs.cache-dir }}
key: trivy-db-${{ steps.current-date.outputs.current-date }}
restore-keys: |
trivy-db-${{ steps.current-date.outputs.current-date }}
- if: steps.restore-db.outputs.cache-hit != 'true'
shell: bash
run: trivy fs --download-db-only --cache-dir "${{ inputs.cache-dir }}"