File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ del.merge_request.id ()
7474get.commit.status ()
7575{ # $1=project, $2=sha
7676 api " GET" " projects/${1} /repository/commits/${2} /statuses" \
77- | jq -r ' .[].status'
77+ | jq -r ' .[].status' \
78+ | head -n 1 \
79+ | tr -d ' [:space:]'
7880}
7981
8082poll.commit.status ()
@@ -83,21 +85,19 @@ poll.commit.status ()
8385 local status laststatus
8486
8587 let attempt+=1
86- laststatus=" pending"
87- status=" new"
8888
8989 while true ; do
9090 attempt=$(( $attempt + 1 ))
91- status=$( get.commit.status " ${1} " " ${2} " )
91+ status=$( echo $( get.commit.status " ${1} " " ${2} " ) )
9292
9393 info " polling commit status: ${attempt} "
9494
9595 case " ${status:- } " in
9696 success) return 0 ;;
9797 failed) return 1 ;;
9898 canceled) return 1 ;;
99- * ) if [ " ${status} " != " ${laststatus} " ]; then
100- info " - pipeline in ${status} was ${laststatus:- } "
99+ * ) if [ " ${status} " != " ${laststatus:- } " ]; then
100+ info " - pipeline in ${status:- none } was ${laststatus:- none } "
101101 fi
102102 ;;
103103 esac
You can’t perform that action at this time.
0 commit comments