mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-04-10 06:44:37 +00:00
chore(ci): fix possible empty version meta on image (#750)
This ensures that when inspecting upstream image, if an error occurs, or the resulting value is empty or 'null', we fail our build instead of propegating a bogus version downstream. Relates: https://github.com/ublue-os/main/issues/487
This commit is contained in:
parent
950e7c7c07
commit
29ea11a14b
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -183,7 +183,9 @@ jobs:
|
||||
|
||||
- name: Get Current Fedora Version
|
||||
id: labels
|
||||
shell: bash
|
||||
run: |
|
||||
set -eo pipefail
|
||||
if [[ "${{ matrix.base_name }}" == "bazzite-nvidia" ]]; then
|
||||
ver=$(skopeo inspect docker://ghcr.io/ublue-os/bazzite-${{ env.IMAGE_FLAVOR }}:${{ matrix.major_version }} | jq -r '.Labels["org.opencontainers.image.version"]')
|
||||
elif [[ "${{ env.IMAGE_FLAVOR}}" == "main" ]]; then
|
||||
@ -191,6 +193,10 @@ jobs:
|
||||
else
|
||||
ver=$(skopeo inspect docker://ghcr.io/ublue-os/${{ matrix.base_image_name }}-${{ env.IMAGE_FLAVOR }}:${{ matrix.major_version }} | jq -r '.Labels["org.opencontainers.image.version"]')
|
||||
fi
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user