ci: avoid build failure when short commit SHA contains only numbers

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4538
GitOrigin-RevId: 63700682a1b3b6fd68c6be22cde210f5e1e8f559
This commit is contained in:
Vishnu Bharathi 2022-05-24 01:39:41 +05:30 committed by hasura-bot
parent 82ceafaf44
commit 78b94ce765

View File

@ -33,7 +33,7 @@ GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "-dirty" || echo "")
VERSION="${GIT_TAG_EXACT}"
# IMPORTANT: SHA hash needs to come first so we get a unique version string,
# even in the presence of truncation below
test -n "$VERSION" || VERSION="${GIT_SHA}${GIT_DIRTY}-${GIT_BRANCH}"
test -n "$VERSION" || VERSION="dev-${GIT_SHA}${GIT_DIRTY}-${GIT_BRANCH}"
VERSION="$(echo $VERSION | tr -cd '[[:alnum:]]._-')"
# Truncate to 50 chars. See: https://github.com/hasura/graphql-engine-mono/pull/4183