fix(ci): inspect pushed tag instead of re-deriving from github.sha

This commit is contained in:
germondai
2026-07-22 20:02:28 +02:00
parent 2b146e36bd
commit f633edb5a8
+8 -7
View File
@@ -115,13 +115,14 @@ jobs:
- name: Inspect manifest
env:
IMAGE: ${{ env.IMAGE }}
REF: ${{ github.ref }}
SHA: ${{ github.sha }}
run: |
if [[ "$REF" == refs/tags/v* ]]; then
tag="${REF#refs/tags/}"
else
tag="nightly-$SHA"
fi
# Pull the first tag actually pushed by docker/metadata-action in the previous
# step (env var DOCKER_METADATA_OUTPUT_JSON). The legacy logic re-derived from
# ${{ github.ref }} / ${{ github.sha }}, but `type=sha,prefix=nightly-` writes
# the short 7-char SHA while `${{ github.sha }}` is the full 40-char hash, so
# the inspect always 404'd on main pushes (e.g. searched for
# nightly-2b146e36bd89510b0027978d72fdcb2a95b5bb37 but only
# nightly-2b146e3 was pushed).
tag=$(jq -r '.tags[0]' <<< "$DOCKER_METADATA_OUTPUT_JSON")
docker buildx imagetools inspect "$IMAGE:$tag"