Files
sec-actions/.gitea/workflows/ci.yaml
T
renovate-bot 31859149c1
CD / Release (push) Successful in 5s
chore(deps): update actions/checkout digest to df4cb1c (#57)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://github.com/actions/checkout) ([changelog](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd..df4cb1c069e1874edd31b4311f1884172cec0e10)) | action | digest | `de0fac2` → `df4cb1c` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFjdGlvbiIsImRlcHMiXX0=-->

---------

Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Reviewed-on: #57
Reviewed-by: t.behrendt <2+t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-06-13 12:48:02 +02:00

113 lines
4.9 KiB
YAML

name: CI
on:
pull_request:
jobs:
test-setup-trivy:
strategy:
matrix:
arch: [amd64, arm64]
name: Test Setup Trivy ${{ matrix.arch }}
runs-on:
- ubuntu-latest
- linux_${{ matrix.arch }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Trivy
uses: ./setup-trivy
- name: Run Trivy
run: trivy --version
test-setup-db:
name: Test Setup DB
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./setup-trivy
- name: Setup DB
id: setup-db
uses: ./setup-db
- name: Run Trivy
run: trivy fs --skip-db-update --cache-dir ${{ steps.setup-db.outputs.cache-dir }} .
test-get-images-from-files:
name: Test Get Images From Files
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- id: giff
uses: ./get-images-from-files
with:
files: |
- get-images-from-files/test.Dockerfile
- get-images-from-files/test-deployment.yaml
- get-images-from-files/test-compose.yaml
- get-images-from-files/test-values-helmfile.yaml
- name: Check image formats extracted
run: |
images='${{ steps.giff.outputs.images }}'
echo "JSON array (for manual inspection):"
echo "$images" | jq .
echo ""
check() { echo -n " $1: "; echo "$images" | jq -e --arg ref "$2" 'index($ref) != null' >/dev/null && echo "OK" || { echo "FAIL (not found)"; exit 1; }; }
# Dockerfile-only refs
check "Dockerfile registry+tag (nginx:v1)" "example.com/library/nginx:v1"
check "Dockerfile registry+digest (base@sha256:...)" "example.com/library/base@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# K8s-only refs
check "K8s registry+tag (app:v2)" "example.com/library/app:v2"
check "K8s registry+digest (helper@sha256:...)" "example.com/myproject/helper@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
# Compose-only refs
check "Compose registry+tag (web:v3)" "example.com/compose/web:v3"
check "Compose registry+tag (worker:v3)" "example.com/compose/worker:v3"
# Helmfile values (repository + tag, optional registry)
check "Helmfile image (repository+tag)" "example.com/helmfile/app:v4"
check "Helmfile images.worker (repository+tag)" "example.com/helmfile/worker:v5"
check "Helmfile images.helper (repository+tag with digest)" "example.com/myproject/helper:2.0@sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
# Shared ref (in both files) — must appear exactly once
check "Shared ref present (distroless/static:nonroot)" "example.com/distroless/static:nonroot"
count=$(echo "$images" | jq '[.[] | select(. == "example.com/distroless/static:nonroot")] | length')
echo -n " Shared ref appears once (no duplicates): "
[ "$count" -eq 1 ] && echo "OK (count=$count)" || { echo "FAIL (count=$count, expected 1)"; exit 1; }
total=$(echo "$images" | jq 'length')
echo -n " Total unique refs: "
[ "$total" -eq 10 ] && echo "OK ($total)" || { echo "FAIL (got $total, expected 10)"; exit 1; }
echo ""
echo "All checks passed."
test-merge-sarif-files:
name: Test Merge SARIF Files
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Merge SARIF Files
uses: ./merge-sarif-files
with:
files: |
- merge-sarif-files/test_sarif1.json
- merge-sarif-files/test_sarif2.json
output-file: merged.sarif
- name: Check merged SARIF file
run: |
# Structure: version, schema, 2 runs
run_count=$(jq '.runs | length' merged.sarif)
[ "$run_count" -eq 2 ] || { echo "FAIL: expected 2 runs, got $run_count"; exit 1; }
echo "Merged SARIF has $run_count runs."
jq -e '.version and .["$schema"] and (.runs | length > 0)' merged.sarif >/dev/null || { echo "FAIL: invalid SARIF structure"; exit 1; }
# Content: results from test_sarif1.json (ruleId KSV-0014) and test_sarif2.json (ruleId CVE-2026-26019) must be present
rule_ids=$(jq -r '[.runs[].results[].ruleId] | unique[]' merged.sarif)
echo "$rule_ids" | grep -q 'KSV-0014' || { echo "FAIL: merged file missing result from test_sarif1.json (ruleId KSV-0014)"; exit 1; }
echo "$rule_ids" | grep -q 'CVE-2026-26019' || { echo "FAIL: merged file missing result from test_sarif2.json (ruleId CVE-2026-26019)"; exit 1; }
echo "Merged results contain ruleIds from both input files."
echo "All checks passed."