Files
ci-actions/README.md
T
2026-10-25 18:14:04 +01:00

59 lines
1.8 KiB
Markdown

# ci-actions
Shared composite actions for Gitea Actions.
## trivy-gate
Scans a pushed image with Trivy (vulnerabilities + secrets) and fails when it
finds a **fixable** vulnerability of the given severities (default
`HIGH,CRITICAL`) or an embedded secret. Vulnerabilities without a fix are
reported but never block - otherwise a deploy could be stuck forever.
Intended order in a pipeline:
1. build and push only the immutable tag (`sha-…`)
2. `trivy-gate` on that tag
3. move the floating tag (`latest`, `stable-<arch>`) and deploy
```yaml
- id: trivy
uses: https://git.rfa.cz/tth-pub/ci-actions/trivy-gate@v1
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ steps.build.outputs.sha }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
platform: linux/arm64 # single-platform non-amd64 images only
mode: block # or warn
skip: ${{ inputs.skip_trivy || 'false' }}
```
Accepted risks go to `.trivyignore.yaml` in the calling repo, each with a
statement and an expiry, so they come back on their own:
```yaml
vulnerabilities:
- id: CVE-2026-12345
statement: not reachable, the affected feature is disabled
expired_at: 2026-12-31
```
The vulnerability DB lives in the Docker named volume `trivy-cache` on the
runner host (refreshed under an exclusive lock, scans read it read-only under
a shared lock, so parallel matrix jobs are fine).
## dtrack-sbom
Converts the `trivy-gate` report to CycloneDX and uploads it to
Dependency-Track. Never fails the job.
```yaml
- uses: https://git.rfa.cz/tth-pub/ci-actions/dtrack-sbom@v1
with:
report: ${{ steps.trivy.outputs.report }}
url: ${{ vars.DTRACK_URL }}
api-key: ${{ secrets.DTRACK_API_KEY }}
ca-pem: ${{ vars.RFA_CA_PEM }}
project: my-image
version: latest
```