Skip to content

Commit fde1d34

Browse files
newlines
1 parent 79efd94 commit fde1d34

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/scripts/gitlab

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ del.merge_request.id ()
7474
get.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

8082
poll.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

0 commit comments

Comments
 (0)