From 25faadbadd456ffd618b8e721f2d24afca82ae00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:16:41 +0200 Subject: [PATCH] Move log inside while loop --- scripts/wait-for-workflow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/wait-for-workflow.sh b/scripts/wait-for-workflow.sh index 37c26c5..053c48c 100644 --- a/scripts/wait-for-workflow.sh +++ b/scripts/wait-for-workflow.sh @@ -28,8 +28,8 @@ else echo "ℹ️ Workflow ID: $workflow_id" # Wait for the workflow to be triggered - echo "⏳ Waiting for the workflow to be triggered..." while true; do + echo "⏳ Waiting for the workflow to be triggered..." response=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $GITHUB_TOKEN" \ "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/actions/workflows/${workflow_id}/runs") if echo "$response" | grep -q "API rate limit exceeded"; then @@ -59,8 +59,8 @@ else fi # Wait for the triggered workflow to complete and check its conclusion -echo "⌛ Waiting for the workflow to complete..." while true; do + echo "⌛ Waiting for the workflow to complete..." run_data=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $GITHUB_TOKEN" \ "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/actions/runs/$run_id") status=$(echo "$run_data" | jq -r '.status')