5c7c84b972
renovate/stability-days Updates have not met minimum release age requirement
CI / Test Setup Trivy amd64 (pull_request) Successful in 9s
CI / Test Get Images From Files (pull_request) Successful in 6s
CI / Test Merge SARIF Files (pull_request) Successful in 5s
CI / Test Setup Trivy arm64 (pull_request) Successful in 3m15s
CI / Test Setup DB (pull_request) Successful in 4m38s
36 lines
1.0 KiB
YAML
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@27d5ce7f107fe9357f9df03efb73ab90386fccae # 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 }}"
|