sdk_lib: Encode full sha into version for dev builds in github actions

This gives emerge-gitclone the full sha so that it can fetch by hash from the
remote repository, which lets it succeed for PRs from external contributors.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-11-28 13:43:14 +01:00
parent afbaf34e4d
commit 95f036d9f7

View File

@ -55,7 +55,12 @@ function yell() {
function get_git_version() {
local tag="$(git tag --points-at HEAD)"
if [ -z "$tag" ] ; then
git describe --tags
local abbrev=
# emerge-gitclone needs the full SHA for external PRs
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
abbrev="--abbrev=40"
fi
git describe --tags ${abbrev}
else
echo "$tag"
fi