From 3b97bf651e550c3fc90de4228270bddaf0550163 Mon Sep 17 00:00:00 2001 From: Patrick O'Reilly Date: Thu, 17 Sep 2026 02:21:25 -0700 Subject: [PATCH] ci: fix the multi-arch manifest check, which failed a correct manifest (#552) The verification step matched '"architecture":"[a-z0-9]+"' against the output of `docker buildx imagetools inspect --raw`. That output is pretty-printed -- the bytes are '"architecture": "amd64"', with a space -- so the regex matched nothing, `got` came back empty, and the step failed a manifest list that was correct. Seen on the first real publish: :latest was stitched properly and advertises linux/amd64 and linux/arm64, but the job that exists to prove that reported failure. The step only runs on a dispatch or a version tag, so it had never executed before and shipped unexercised. Parse the index with jq instead of grepping its formatting, and assert on os/arch pairs. Checked both ways against the live registry: it passes the current multi-arch :latest and fails :latest-amd64. --- .github/workflows/docker.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 52e4a7a7..89fbbc43 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -210,10 +210,18 @@ jobs: # Assert the thing this whole change exists for, rather than assuming the # stitch worked: the published manifest must advertise both platforms. + # Parse the index rather than grepping it. The first version of this + # matched '"architecture":"[a-z0-9]+"' against the raw JSON, but + # `imagetools inspect --raw` pretty-prints -- the bytes are + # '"architecture": "amd64"', with a space -- so it matched nothing and + # failed a manifest that was in fact correct. It shipped unexercised + # because this job only runs on a dispatch or a tag, and the first real + # publish was the first time it ever ran (#552). - name: Verify the manifest lists both platforms run: | got=$(docker buildx imagetools inspect --raw ghcr.io/orlyatomics/orly:latest \ - | grep -oE '"architecture":"[a-z0-9]+"' | sort -u | tr '\n' ' ') - echo "manifest advertises: $got" - echo "$got" | grep -q '"architecture":"amd64"' - echo "$got" | grep -q '"architecture":"arm64"' + | jq -r '.manifests[]?.platform | select(. != null) | "\(.os)/\(.architecture)"' \ + | sort -u) + echo "manifest advertises:"; echo "$got" | sed 's/^/ /' + grep -qx 'linux/amd64' <<<"$got" + grep -qx 'linux/arm64' <<<"$got"