Skip to content

Commit 0ef509c

Browse files
committed
fix(ci): try to fix manifest creation
1 parent 72efd9e commit 0ef509c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,14 @@ jobs:
170170
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
171171
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
172172
173-
# Get the digest of the multi-arch manifest
174-
DIGEST=$(docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --format '{{.Manifest.Digest}}')
173+
# Get the digest of the multi-arch manifest using docker inspect
174+
DIGEST=$(docker manifest inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | jq -r '.digest // empty')
175+
if [ -z "$DIGEST" ]; then
176+
# Fallback: get digest from the registry API
177+
DIGEST=$(docker inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --format='{{index .RepoDigests 0}}' | cut -d'@' -f2)
178+
fi
175179
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
180+
echo "Manifest digest: $DIGEST"
176181
177182
- name: Generate SLSA attestation for multi-arch manifest
178183
uses: actions/attest-build-provenance@v1

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ jobs:
115115
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
116116
done
117117
118-
# Get the digest of the release manifest
119-
DIGEST=$(docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} --format '{{.Manifest.Digest}}')
118+
# Get the digest of the release manifest using docker inspect
119+
DIGEST=$(docker manifest inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | jq -r '.digest // empty')
120+
if [ -z "$DIGEST" ]; then
121+
# Fallback: get digest from the registry API
122+
DIGEST=$(docker inspect ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} --format='{{index .RepoDigests 0}}' | cut -d'@' -f2)
123+
fi
120124
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
125+
echo "Release manifest digest: $DIGEST"
121126
122127
- name: Generate SLSA attestation for release manifest
123128
uses: actions/attest-build-provenance@v1

0 commit comments

Comments
 (0)