From d4421b99a8e5ea19ea997f0d6740dd7d75ef62f6 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 6 Feb 2024 22:26:42 -0600 Subject: [PATCH] chore(ci): fix possible empty version meta on image (#70) --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 358174d..b01573c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,8 +127,14 @@ jobs: - name: Get current Fedora version id: labels + shell: bash run: | + set -eo pipefail ver=$(skopeo inspect docker://ghcr.io/ublue-os/${{ matrix.base_image_name }}${{ matrix.image_flavor }}:${{ 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 # Build metadata