From d570ba70ed879cf252208f850215e7c96f7a7d59 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Sun, 25 Oct 2026 18:54:48 +0100 Subject: [PATCH] ci: Trivy gate on the dependency lockfiles before the APK is built and released, SBOM to Dependency-Track Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9e6761fd..b1e083db 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,6 +19,11 @@ name: build push: branches: [tth] workflow_dispatch: + inputs: + skip_trivy: + description: "skip the Trivy gate (EMERGENCY, logged)" + type: boolean + default: false concurrency: group: build @@ -87,6 +92,21 @@ jobs: flutter pub get flutter test --no-pub -r failures-only + # Trivy gate (tth-pub/ci-actions): a fixable HIGH/CRITICAL in the + # dependencies (pubspec.lock from the pub get above, Podfile/SwiftPM + # locks) or a secret in the tree = no APK, no release. Accepted risks + # with a reason and expiry in .trivyignore.yaml. No Docker in this + # container, so the action runs its checksum-verified Trivy binary. + # mode: warn = phase 1 (report only), block = phase 2. + - name: Trivy gate + id: trivy + if: steps.rel.outputs.needed == 'true' + uses: https://git.rfa.cz/tth-pub/ci-actions/trivy-gate@v1.1 + with: + scan-type: fs + mode: warn + skip: ${{ inputs.skip_trivy && 'true' || 'false' }} + - name: Build signed APK if: steps.rel.outputs.needed == 'true' id: apk @@ -159,6 +179,19 @@ jobs: echo "removed $tag" done + # SBOM of the released dependencies to Dependency-Track from the same + # scan; a DT outage (or a missing key) does not fail the release. + - name: SBOM to Dependency-Track + if: steps.rel.outputs.needed == 'true' + uses: https://git.rfa.cz/tth-pub/ci-actions/dtrack-sbom@v1.1 + with: + report: ${{ steps.trivy.outputs.report }} + url: https://dtrack.grg + api-key: ${{ secrets.DTRACK_API_KEY }} + ca-pem: ${{ vars.RFA_CA_PEM }} + project: meshcore-open + version: tth + - name: Close failure issue if: success() env: