From 72bad0f16a049b90c6af5088086b88cfc942a0bb Mon Sep 17 00:00:00 2001 From: nomennescio Date: Mon, 16 Oct 2023 13:35:52 +0200 Subject: [PATCH] Fixed issue with collapsing branch names for pull requests CURRENT_BRANCH_FULL added to track info during Github builds. Can potentially be removed. --- build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 62341117ff..9c0a8f2943 100755 --- a/build.sh +++ b/build.sh @@ -331,6 +331,7 @@ echo_build_info() { $ECHO "DEBUG=$DEBUG" $ECHO "REPRODUCIBLE=$REPRODUCIBLE" $ECHO "CURRENT_BRANCH=$CURRENT_BRANCH" + $ECHO "CURRENT_BRANCH_FULL=$CURRENT_BRANCH_FULL" $ECHO "FACTOR_BINARY=$FACTOR_BINARY" $ECHO "FACTOR_LIBRARY=$FACTOR_LIBRARY" $ECHO "FACTOR_IMAGE=$FACTOR_IMAGE" @@ -521,7 +522,7 @@ make_clean_factor() { current_git_branch() { # git rev-parse --abbrev-ref HEAD # outputs HEAD for detached head # outputs nothing for detached HEAD, which is fine for ``git fetch`` - git describe --all --exact-match 2>/dev/null | sed 's=.*/==' + git describe --all --exact-match 2>/dev/null } check_url() { @@ -564,7 +565,8 @@ set_current_branch() { if [ -n "${CI_BRANCH}" ]; then CURRENT_BRANCH="${CI_BRANCH}" else - CURRENT_BRANCH=$(current_git_branch) + CURRENT_BRANCH_FULL=$(current_git_branch) + CURRENT_BRANCH=$($ECHO $CURRENT_BRANCH_FULL | sed -E 's=(heads|remotes)/==') fi } -- 2.34.1