Skip to content

Commit 6f223ff

Browse files
authored
ci: fix image signing on main (#1332)
1 parent 913b872 commit 6f223ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/publish_dockerhub_k8s_cache_main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ jobs:
163163
IMAGE_TO_INSPECT: ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
164164
run: |
165165
for i in 1 2 3 4 5; do
166-
DIGEST=$(docker buildx imagetools inspect "${IMAGE_TO_INSPECT}" --format '{{.Manifest.Digest}}' 2>/dev/null | tr -d '\n')
167-
[ -n "${DIGEST}" ] && break
166+
DIGEST=$(docker buildx imagetools inspect "${IMAGE_TO_INSPECT}" --format '{{json .Manifest}}' 2>/dev/null | jq -r '.digest' | tr -d '\n')
167+
[ -n "${DIGEST}" ] && [ "${DIGEST}" != "null" ] && break
168168
echo "Inspect attempt $i failed, retrying in 5s..."
169169
sleep 5
170170
done
171-
if [ -z "${DIGEST}" ]; then echo "Failed to inspect image after 5 attempts"; exit 1; fi
171+
if [ -z "${DIGEST}" ] || [ "${DIGEST}" = "null" ]; then echo "Failed to inspect image after 5 attempts"; exit 1; fi
172172
images=""
173173
for tag in ${TAGS}; do
174174
images+="${tag}@${DIGEST} "

.github/workflows/publish_dockerhub_main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ jobs:
163163
IMAGE_TO_INSPECT: ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
164164
run: |
165165
for i in 1 2 3 4 5; do
166-
DIGEST=$(docker buildx imagetools inspect "${IMAGE_TO_INSPECT}" --format '{{.Manifest.Digest}}' 2>/dev/null | tr -d '\n')
167-
[ -n "${DIGEST}" ] && break
166+
DIGEST=$(docker buildx imagetools inspect "${IMAGE_TO_INSPECT}" --format '{{json .Manifest}}' 2>/dev/null | jq -r '.digest' | tr -d '\n')
167+
[ -n "${DIGEST}" ] && [ "${DIGEST}" != "null" ] && break
168168
echo "Inspect attempt $i failed, retrying in 5s..."
169169
sleep 5
170170
done
171-
if [ -z "${DIGEST}" ]; then echo "Failed to inspect image after 5 attempts"; exit 1; fi
171+
if [ -z "${DIGEST}" ] || [ "${DIGEST}" = "null" ]; then echo "Failed to inspect image after 5 attempts"; exit 1; fi
172172
images=""
173173
for tag in ${TAGS}; do
174174
images+="${tag}@${DIGEST} "

0 commit comments

Comments
 (0)