Commit 923b8d7
fix(ci): cosign sign container manifest by tag, not by local podman digest
The cosign step of the release workflow failed with MANIFEST_UNKNOWN on
every release attempt after multi-arch builds were restored, e.g. on
v0.45.0:
Error: signing [ghcr.io/slashdevops/idp-scim-sync@sha256:2925...]:
GET https://ghcr.io/v2/.../manifests/sha256:2925...: MANIFEST_UNKNOWN
The previous logic resolved the digest to sign by piping
`podman manifest inspect ghcr.io/...:TAG` into
`jq -r '.digest // .manifests[0].digest'`. Two compounding bugs:
1. A manifest list's own JSON has no top-level `.digest` (the list's
digest is computed by hashing the JSON, not stored inside it), so
the `//` fallback always returned `.manifests[0].digest` -- which is
the digest of the first per-arch image (arm64), not of the manifest
list itself.
2. Podman re-serializes manifests on push (media-type conversion
between Docker manifest.v2+json and OCI image.manifest.v1+json),
so the locally computed digest does not match what GHCR stores.
Cosign's lookup at that local digest therefore returned 404.
Switch to `cosign sign --recursive ${IMAGE}:${TAG}`. Cosign internally
HEAD-resolves the tag to the authoritative on-registry digest and
signs that digest, so the resulting artifact is identical to what the
broken code intended to produce. The classic "signing by tag races
with concurrent pushes" caveat does not apply: this job exclusively
owns the v<x.y.z> and latest tags and has just pushed them
sequentially in the previous step.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2cf16ba commit 923b8d7
2 files changed
Lines changed: 30 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
97 | 106 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
7 | 22 | | |
8 | 23 | | |
9 | 24 | | |
| |||
0 commit comments