name: "Setup Trivy DB" description: "Setup the trivy database, restoring from cache if available" author: "Timo Behrendt > $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 }} trivy-db- - if: steps.restore-db.outputs.cache-hit != 'true' shell: bash run: trivy fs --download-db-only --cache-dir "${{ inputs.cache-dir }}"