Skip to content

Commit 8316c2d

Browse files
Bar MagneziBar Magnezi
authored andcommitted
Fix CR
1 parent 6c3bdc5 commit 8316c2d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/commands/trigger-workflows-for-all-modified.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ steps:
268268
workflow_id=$(jq -r .id /tmp/swissknife/triggered_workflow.json)
269269
echo ""
270270
echo "Waiting for workflow: ${workflow_id} to complete"
271-
sleep << parameters.sleep-time-between-checks >>
271+
if (( $total == 0 )); then
272+
sleep << parameters.sleep-time-between-checks >>
273+
fi
272274
273275
while true; do
274276
workflow_status=/tmp/swissknife/workflow_status.json
@@ -289,10 +291,10 @@ steps:
289291
running=$(jq -s 'map(select(.status == "running")) | length' ${workflow_status})
290292
success=$(jq -s 'map(select(.status == "success")) | length' ${workflow_status})
291293
echo "total: ${total}, running: ${running}, success: ${success}"
292-
if (( $total == 0 && $running == 0 )); then
294+
if (( $total == 0 )); then
293295
echo "No running workflows, return success"
294296
exit 0
295-
elif (( $total == 0 || $running > 0 )); then
297+
elif (( $running > 0 )); then
296298
echo "Going to sleep for << parameters.sleep-time-between-checks >>"
297299
sleep << parameters.sleep-time-between-checks >>
298300
elif (( $total == $success )); then

0 commit comments

Comments
 (0)