File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11FROM alpine:3.15.0
22
3- RUN apk update
4- RUN apk --no-cache add curl jq coreutils
3+ RUN apk update \
4+ && apk --no-cache add curl jq coreutils
55
66COPY entrypoint.sh /entrypoint.sh
77
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ validate_args() {
6969 exit 1
7070 fi
7171
72- client_payload=$( echo ' {}' | jq)
72+ client_payload=$( echo ' {}' | jq -c )
7373 if [ " ${INPUT_CLIENT_PAYLOAD} " ]
7474 then
75- client_payload=$( echo " ${INPUT_CLIENT_PAYLOAD} " | jq)
75+ client_payload=$( echo " ${INPUT_CLIENT_PAYLOAD} " | jq -c )
7676 fi
7777
7878 ref=" main"
@@ -100,6 +100,12 @@ api() {
100100 fi
101101}
102102
103+ lets_wait () {
104+ local interval=${1:- $wait_interval }
105+ echo >&2 " Sleeping for $interval seconds"
106+ sleep " $interval "
107+ }
108+
103109# Return the ids of the most recent workflow runs, optionally filtered by user
104110get_workflow_runs () {
105111 since=${1:? }
@@ -129,8 +135,7 @@ trigger_workflow() {
129135 NEW_RUNS=$OLD_RUNS
130136 while [ " $NEW_RUNS " = " $OLD_RUNS " ]
131137 do
132- echo >&2 " Sleeping for ${wait_interval} seconds"
133- sleep " $wait_interval "
138+ lets_wait
134139 NEW_RUNS=$( get_workflow_runs " $SINCE " )
135140 done
136141
@@ -154,8 +159,7 @@ wait_for_workflow_to_finish() {
154159
155160 while [[ " ${conclusion} " == " null" && " ${status} " != " completed" ]]
156161 do
157- echo " Sleeping for \" ${wait_interval} \" seconds"
158- sleep " ${wait_interval} "
162+ lets_wait
159163
160164 workflow=$( api " runs/$last_workflow_id " )
161165 conclusion=$( echo " ${workflow} " | jq -r ' .conclusion' )
You can’t perform that action at this time.
0 commit comments