Skip to content

Commit 885bbb3

Browse files
newlines
1 parent 79efd94 commit 885bbb3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/scripts/gitlab

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ 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+
| tr -d '[:space:]'
7879
}
7980

8081
poll.commit.status ()
@@ -83,21 +84,19 @@ poll.commit.status ()
8384
local status laststatus
8485

8586
let attempt+=1
86-
laststatus="pending"
87-
status="new"
8887

8988
while true; do
9089
attempt=$(($attempt + 1))
91-
status=$(get.commit.status "${1}" "${2}")
90+
status=$(echo $(get.commit.status "${1}" "${2}"))
9291

9392
info "polling commit status: ${attempt}"
9493

9594
case "${status:-}" in
9695
success) return 0 ;;
9796
failed) return 1 ;;
9897
canceled) return 1 ;;
99-
*) if [ "${status}" != "${laststatus}" ]; then
100-
info "- pipeline in ${status} was ${laststatus:-}"
98+
*) if [ "${status}" != "${laststatus:-}" ]; then
99+
info "- pipeline in ${status:-none} was ${laststatus:-none}"
101100
fi
102101
;;
103102
esac

0 commit comments

Comments
 (0)