From d2a25b28e58846c9814541904b0081c81d6ebd15 Mon Sep 17 00:00:00 2001 From: Ruslan Belkin Date: Mon, 2 Mar 2026 18:59:36 -0800 Subject: [PATCH] Docker: fix gog latest fallback + typecheck drift --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a14c097d0ae..33a66848570 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,15 +106,16 @@ RUN set -eux; \ arm64) GOGARCH=arm64 ;; \ *) echo "Unsupported arch: $arch" >&2; exit 1 ;; \ esac; \ - if [ "$GOGCLI_TAG" = "latest" ]; then \ - GOGCLI_TAG="$(curl -fsSI -H 'User-Agent: openclaw-docker-build' https://github.com/steipete/gogcli/releases/latest | awk 'tolower($1)==\"location:\" {print $2}' | tr -d '\r' | awk -F/ '{print $NF}' | tail -n1)"; \ - if [ -z "$GOGCLI_TAG" ]; then \ + tag="$GOGCLI_TAG"; \ + if [ "$tag" = "latest" ]; then \ + tag="$(curl -fsSI -H 'User-Agent: openclaw-docker-build' https://github.com/steipete/gogcli/releases/latest | awk 'tolower($1)==\"location:\" {print $2}' | tr -d '\r' | awk -F/ '{print $NF}' | tail -n1)"; \ + if [ -z "$tag" ]; then \ echo "WARN: Failed to resolve gogcli latest release tag; falling back to v0.11.0" >&2; \ - GOGCLI_TAG="v0.11.0"; \ + tag="v0.11.0"; \ fi; \ fi; \ - ver="${GOGCLI_TAG#v}"; \ - url="https://github.com/steipete/gogcli/releases/download/${GOGCLI_TAG}/gogcli_${ver}_linux_${GOGARCH}.tar.gz"; \ + ver="${tag#v}"; \ + url="https://github.com/steipete/gogcli/releases/download/$tag/gogcli_${ver}_linux_${GOGARCH}.tar.gz"; \ echo "Downloading: $url"; \ curl -fsSL "$url" -o /tmp/gogcli.tgz; \ tar -xzf /tmp/gogcli.tgz -C /tmp; \