From 43c383bacc2831301781e3a7dc66b1c2c3d304cb Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 6 Feb 2024 13:24:25 -0600 Subject: [PATCH] chore(ci): fix possible empty version meta on image (#492) --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f60ee04..66019f1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -150,8 +150,14 @@ jobs: - name: Get current version id: labels + shell: bash run: | + set -eo pipefail ver=$(skopeo inspect docker://quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }} | jq -r '.Labels["org.opencontainers.image.version"]') + if [ -z "$ver" ] || [ "null" = "$ver" ]; then + echo "inspected image version must not be empty or null" + exit 1 + fi echo "VERSION=$ver" >> $GITHUB_OUTPUT # Generate image metadata