fix: emit full commit sha as ref — git fetch rejects abbreviated ids
Build and Publish HeiniRemote Agent Flatpak / build (push) Failing after 9m25s

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 <noreply@anthropic.com>
This commit is contained in:
pc-heiniandClaude Fable 5 committed 2026-07-07 13:52:48 +02:00
1 parent 95060ddf95
commit 83167b2f7c
1 file changed
+3 -2
+3 -2
View File
@@ -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 <sha>` 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