Skip to content

fix(ci): pin Trivy scan to the matrix platform so the arm64 release gate passes#163

Merged
windischb merged 1 commit into
developfrom
fix/release-trivy-arm64-platform
Jul 21, 2026
Merged

fix(ci): pin Trivy scan to the matrix platform so the arm64 release gate passes#163
windischb merged 1 commit into
developfrom
fix/release-trivy-arm64-platform

Conversation

@windischb

Copy link
Copy Markdown
Contributor

What happened

The first real run of the signed release pipeline (v0.7.0) failed and shipped nothing. The Build Docker (arm64) job's Trivy scan errored with:

no child with platform linux/amd64 in index ghcr.io/cocoar-dev/modgud@sha256:ae083...

That failed the arm64 build → the release gate was skipped → Publish NuGet, Publish Docker, Deploy Docs, and Supply-chain (sign + SBOM) were all skipped. Tests, amd64 build, docs build, and NuGet pack were green; only the arm64 Trivy step failed.

Root cause

On a real release the build pushes each arch by digest with sbom + provenance: mode=max, so buildx wraps the single-arch image in an index (image manifest + attestation manifests). Given an index reference, Trivy resolves to its default platform linux/amd64 regardless of the runner architecture. So the arm64 job (on a native ubuntu-24.04-arm runner) asked for a linux/amd64 child that an arm64-only index does not contain. The amd64 job passed only because its default happened to match.

The dry-run never caught this: it loads a single-platform image into the local daemon (type=docker, no attestations, no index) — a different code path than the pushed-by-digest index the real release scans.

Fix

Set TRIVY_PLATFORM to the matrix platform so each job scans its own arch. One env var, no behaviour change to what gets scanned — both platforms' package sets are still scanned, now correctly resolved.

After merge

v0.7.0 published nothing, so it needs re-running once this lands. The pipeline was built for exactly this ("republishing a botched release after fixing pipeline logic" — the workflow_dispatch path with version_override + dry_run=false). Recommend re-running the release for 0.7.0 from the fixed develop.

🤖 Generated with Claude Code

…ate passes

The first real run of the signed release pipeline (v0.7.0) failed: the arm64
build's Trivy scan errored with 'no child with platform linux/amd64 in index',
which skipped the release gate and therefore ALL publishing (NuGet, Docker, docs,
signing). Nothing shipped.

Root cause: on a real release the build pushes by digest with SBOM + provenance
(mode=max), so buildx wraps each single-arch image in an index (the image
manifest plus attestation manifests). Given an index reference, Trivy resolves to
its default platform linux/amd64 regardless of the runner architecture — so the
arm64 job (on a native arm64 runner) asked for a linux/amd64 child that an
arm64-only index does not contain. The amd64 job passed only because its default
happened to match. The dry-run never caught this: it loads a single-platform
image into the local daemon (type=docker, no attestations, no index), a different
code path than the pushed-by-digest index the real release scans.

Fix: set TRIVY_PLATFORM to the matrix platform so each job scans its own arch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@windischb
windischb merged commit e3cca68 into develop Jul 21, 2026
8 checks passed
@windischb
windischb deleted the fix/release-trivy-arm64-platform branch July 21, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant