From 83167b2f7c545c557c62cf788989f518045c6ef9 Mon Sep 17 00:00:00 2001 From: pc-heini Date: Tue, 7 Jul 2026 13:52:48 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20emit=20full=20commit=20sha=20as=20ref=20?= =?UTF-8?q?=E2=80=94=20git=20fetch=20rejects=20abbreviated=20ids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tagless fallback truncated the sha to 12 chars for the version string and reused that as ref, so the upstream fetch failed with 'couldn't find remote ref'. Keep the full sha for ref, shorten only the version suffix. Co-Authored-By: Claude Fable 5 --- scripts/get-latest-version.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/get-latest-version.sh b/scripts/get-latest-version.sh index 840bf5e..4e3c2b8 100755 --- a/scripts/get-latest-version.sh +++ b/scripts/get-latest-version.sh @@ -24,8 +24,9 @@ if [ -n "$tag" ]; then echo "version=${tag#v}" echo "ref=$tag" else - sha=$(git ls-remote "$UPSTREAM_URL" refs/heads/main | cut -c1-12) + # ref must stay the full sha: `git fetch ` rejects abbreviated ids. + sha=$(git ls-remote "$UPSTREAM_URL" refs/heads/main | awk '{print $1}') [ -n "$sha" ] || { echo "ERROR: cannot resolve upstream main" >&2; exit 1; } - echo "version=0.0.0-git.$sha" + echo "version=0.0.0-git.${sha:0:12}" echo "ref=$sha" fi