diff --git a/.forgejo/workflows/publish-image.yaml b/.forgejo/workflows/publish-image.yaml index 736326a..9b572cf 100644 --- a/.forgejo/workflows/publish-image.yaml +++ b/.forgejo/workflows/publish-image.yaml @@ -97,8 +97,8 @@ jobs: "${BUILD_CONTEXT}" PUSH_OUTPUT="$(docker push "${IMAGE}:${SOURCE_TAG}")" printf '%s\n' "${PUSH_OUTPUT}" - IMAGE_DIGEST="$(printf '%s\n' "${PUSH_OUTPUT}" | awk '/digest: sha256:/{print $2}' | tail -1)" - test -n "${IMAGE_DIGEST}" + IMAGE_DIGEST="$(printf '%s\n' "${PUSH_OUTPUT}" | tr '\r' '\n' | awk '{for (i=1; i<=NF; i++) if ($i ~ /^sha256:[a-f0-9]{64}$/) print $i}' | tail -1)" + printf '%s' "${IMAGE_DIGEST}" | grep -Eq '^sha256:[a-f0-9]{64}$' docker push "${IMAGE}:${REVISION_TAG}" docker push "${IMAGE}:main"