From 95f036d9f7ad55cc9e930112b2e0519e6a9d8465 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 28 Nov 2024 13:43:14 +0100 Subject: [PATCH] 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 --- sdk_lib/sdk_container_common.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk_lib/sdk_container_common.sh b/sdk_lib/sdk_container_common.sh index b0f94cfbf6..6cc6ab483c 100644 --- a/sdk_lib/sdk_container_common.sh +++ b/sdk_lib/sdk_container_common.sh @@ -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