Skip to content

Commit 919d897

Browse files
guguclaude
andcommitted
fix: compute merged manifest digest from raw bytes instead of Go template
The --format '{{.Manifest.Digest}}' template doesn't work for OCI image indexes. Use --raw | sha256sum to reliably compute the digest. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b5bcbfe commit 919d897

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/build-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
id: manifest
157157
run: |
158158
TAG=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)
159-
DIGEST=$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --format '{{.Manifest.Digest}}')
159+
DIGEST="sha256:$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --raw | sha256sum | cut -d ' ' -f1)"
160160
echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
161161
162162
- name: Attest Merged Manifest Provenance

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
id: manifest
158158
run: |
159159
TAG=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)
160-
DIGEST=$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --format '{{.Manifest.Digest}}')
160+
DIGEST="sha256:$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --raw | sha256sum | cut -d ' ' -f1)"
161161
echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
162162
163163
- name: Attest Merged Manifest Provenance

.github/workflows/quay.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
id: manifest
166166
run: |
167167
TAG=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)
168-
DIGEST=$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --format '{{.Manifest.Digest}}')
168+
DIGEST="sha256:$(docker buildx imagetools inspect "${{ env.REGISTRY_IMAGE }}:${TAG}" --raw | sha256sum | cut -d ' ' -f1)"
169169
echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
170170
171171
- name: Attest Merged Manifest Provenance

0 commit comments

Comments
 (0)