Packaging: Fix our tarball commit logic.

If CI_COMMIT_SHA is set, it probably means we're building in GitLab CI.
Prefer it over our stash commit ID.
This commit is contained in:
Gerald Combs 2022-10-20 15:33:38 -07:00
parent 6d79c8c1f6
commit 1321de7dc3
1 changed files with 8 additions and 3 deletions

View File

@ -72,11 +72,16 @@ if [[ $COMMIT != \$F* ]] ; then
exit 1
fi
COMMIT="${CI_COMMIT_SHA:-HEAD}"
STASH_ID=$(git stash create || echo "")
if [[ -n "$STASH_ID" ]] ; then
if [[ -n "${CI_COMMIT_SHA-}" ]] ; then
echo "Setting commit from CI_COMMIT_SHA"
COMMIT="$CI_COMMIT_SHA"
elif [[ -n "$STASH_ID" ]] ; then
echo "Setting commit from stash"
COMMIT="$STASH_ID"
else
COMMIT="HEAD"
fi
if [ -f "$TARBALL" ] ; then