fix: emit full commit sha as ref — git fetch rejects abbreviated ids
Build and Publish HeiniRemote Agent Flatpak / build (push) Failing after 9m25s
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:
1 parent
95060ddf95
commit
83167b2f7c
1 file changed
+3
-2
@@ -24,8 +24,9 @@ if [ -n "$tag" ]; then
|
|||||||
echo "version=${tag#v}"
|
echo "version=${tag#v}"
|
||||||
echo "ref=$tag"
|
echo "ref=$tag"
|
||||||
else
|
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; }
|
[ -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"
|
echo "ref=$sha"
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user