]> gitweb.factorcode.org Git - factor.git/commitdiff
Fixed issue with collapsing branch names for pull requests
authornomennescio <nomennescio@factorcode.org>
Mon, 16 Oct 2023 11:35:52 +0000 (13:35 +0200)
committernomennescio <nomennescio@factorcode.org>
Mon, 16 Oct 2023 11:35:52 +0000 (13:35 +0200)
CURRENT_BRANCH_FULL added to track info during Github builds. Can potentially be removed.

build.sh

index 62341117ffc4bafcd30c79983ce4193f9edf9646..9c0a8f294387c53ef325a4b78700404916e437bc 100755 (executable)
--- 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
 }