feat: harden setup-db action
CI / Test Get Images From Files (pull_request) Successful in 4s
CI / Test Setup Trivy amd64 (pull_request) Successful in 5s
CI / Test Merge SARIF Files (pull_request) Successful in 5s
CI / Test Setup Trivy arm64 (pull_request) Successful in 39s
CI / Test Setup DB (pull_request) Successful in 1m12s

This commit is contained in:
2026-04-10 18:02:08 +02:00
parent a9ff551b88
commit efef29591b
3 changed files with 42 additions and 5 deletions
+9 -4
View File
@@ -2,7 +2,9 @@
A reusable Gitea Action that sets up the Trivy vulnerability database, restoring from cache if available.
**Note:** This action only sets up the database. Trivy itself must be installed separately (e.g., using the `setup-trivy` action).
The action runs Trivy inside **Docker** with a restricted container configuration so the Trivy runtime is isolated from the host while the database is downloaded into your cache directory.
**Note:** This action only prepares the vulnerability database. If you run Trivy on the runner host for scans (for example `trivy fs .`), install Trivy separately (e.g. with a `setup-trivy` action or your own step).
## Usage
@@ -36,6 +38,9 @@ jobs:
## Inputs
| Input | Description | Required | Default |
| ----------- | --------------------------------- | -------- | ---------------- |
| `cache-dir` | Path to the Trivy cache directory | No | `~/.cache/trivy` |
| Input | Description | Required | Default |
| ---------------- | --------------------------------------------------------------------------- | -------- | ------- |
| `cache-dir` | Path to the Trivy cache directory | No | `${{ runner.temp }}/trivy` |
| `trivy-version` | Docker image reference for Trivy (digest pin recommended) | No | Pinned `ghcr.io/aquasecurity/trivy` image in `action.yaml` |
**`trivy-version` is optional.** If you omit it, the action uses the default image (version and digest) from `action.yaml`. Set it only when you need a different Trivy image or your own digest pin.