Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -103,14 +103,28 @@ jobs:
|
||||
with:
|
||||
name: image
|
||||
path: /tmp
|
||||
- name: Load image
|
||||
run: docker load --input /tmp/image.tar
|
||||
- name: Scan loaded image
|
||||
|
||||
|
||||
# Trivy CLI install (no Docker needed)
|
||||
- name: Install Trivy CLI
|
||||
run: |
|
||||
IMAGE="${{ inputs.image-name }}:${{ inputs.image-tag }}"
|
||||
docker run --rm aquasec/trivy:0.52.2 image \
|
||||
--format json --severity CRITICAL,HIGH --ignore-unfixed \
|
||||
"$IMAGE" > /tmp/trivy-results.json
|
||||
set -euo pipefail
|
||||
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \
|
||||
| sh -s -- -b /usr/local/bin v0.65.0
|
||||
trivy --version
|
||||
|
||||
|
||||
# IMPORTANT: the tar sits under /tmp/image.tar
|
||||
- name: Scan saved image tar with Trivy (no daemon)
|
||||
run: |
|
||||
ls -la /tmp || true
|
||||
trivy image \
|
||||
--input /tmp/image.tar \
|
||||
--format json \
|
||||
--output /tmp/trivy-results.json \
|
||||
--severity CRITICAL,HIGH \
|
||||
--ignore-unfixed
|
||||
|
||||
- name: Upload results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user