Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -103,14 +103,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: image
|
name: image
|
||||||
path: /tmp
|
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: |
|
run: |
|
||||||
IMAGE="${{ inputs.image-name }}:${{ inputs.image-tag }}"
|
set -euo pipefail
|
||||||
docker run --rm aquasec/trivy:0.52.2 image \
|
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \
|
||||||
--format json --severity CRITICAL,HIGH --ignore-unfixed \
|
| sh -s -- -b /usr/local/bin v0.65.0
|
||||||
"$IMAGE" > /tmp/trivy-results.json
|
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
|
- name: Upload results
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user