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 @@ -75,10 +75,10 @@ validate_args() {
7575 exit 1
7676 fi
7777
78- client_payload=$( echo ' {}' | jq)
78+ client_payload=$( echo ' {}' | jq -c )
7979 if [ " ${INPUT_CLIENT_PAYLOAD} " ]
8080 then
81- client_payload=$( echo " ${INPUT_CLIENT_PAYLOAD} " | jq)
81+ client_payload=$( echo " ${INPUT_CLIENT_PAYLOAD} " | jq -c )
8282 fi
8383
8484 ref=" main"
@@ -106,6 +106,12 @@ api() {
106106 fi
107107}
108108
109+ lets_wait () {
110+ local interval=${1:- $wait_interval }
111+ echo >&2 " Sleeping for $interval seconds"
112+ sleep " $interval "
113+ }
114+
109115# Return the ids of the most recent workflow runs, optionally filtered by user
110116get_workflow_runs () {
111117 since=${1:? }
@@ -135,8 +141,7 @@ trigger_workflow() {
135141 NEW_RUNS=$OLD_RUNS
136142 while [ " $NEW_RUNS " = " $OLD_RUNS " ]
137143 do
138- echo >&2 " Sleeping for ${wait_interval} seconds"
139- sleep " $wait_interval "
144+ lets_wait
140145 NEW_RUNS=$( get_workflow_runs " $SINCE " )
141146 done
142147
@@ -160,8 +165,7 @@ wait_for_workflow_to_finish() {
160165
161166 while [[ " ${conclusion} " == " null" && " ${status} " != " completed" ]]
162167 do
163- echo " Sleeping for \" ${wait_interval} \" seconds"
164- sleep " ${wait_interval} "
168+ lets_wait
165169
166170 workflow=$( api " runs/$last_workflow_id " )
167171 conclusion=$( echo " ${workflow} " | jq -r ' .conclusion' )
You can’t perform that action at this time.
0 commit comments