fix: extract openclaw image tag from imageTag attribute instead of store path
Some checks failed
CI / check (push) Successful in 2m41s
CI / build-and-cache (push) Successful in 1m16s
CI / Build & Push OpenClaw Image (push) Failing after 9m2s
CI / Deploy OpenClaw to Cluster (push) Has been skipped

The sed pattern on the store path basename gave 'tar.gz' because
buildLayeredImage outputs 'openclaw.tar.gz'. Use imageTag attribute
which returns the actual tag (e.g., '2026.4.14').
This commit is contained in:
2026-04-20 08:57:02 -07:00
parent 9904d1c11d
commit 576140befb

View File

@@ -129,10 +129,13 @@ jobs:
- name: Generate image tag - name: Generate image tag
id: meta id: meta
run: | run: |
# Read the version from the nix definition # Read the image tag from the nix definition's tag attribute
IMAGE_TAG=$(nix eval .#openclaw-image.outPath --raw 2>/dev/null | xargs basename | sed 's/.*-//') # buildLayeredImage sets tag from openclawImageTag in default.nix
IMAGE_TAG=$(nix eval .#packages.x86_64-linux.openclaw-image.imageTag --raw 2>/dev/null || \
nix eval .#openclaw-image.imageTag --raw 2>/dev/null || \
nix eval .#openclaw-image.outPath --raw 2>/dev/null | xargs basename | sed 's/.*-//')
# Fallback to short SHA if tag extraction fails # Fallback to short SHA if tag extraction fails
if [ -z "$IMAGE_TAG" ]; then if [ -z "$IMAGE_TAG" ] || [ "$IMAGE_TAG" = "tar.gz" ]; then
IMAGE_TAG=$(echo "${{ github.sha }}" | cut -c1-7) IMAGE_TAG=$(echo "${{ github.sha }}" | cut -c1-7)
fi fi
echo "tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT echo "tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT