From 08f75e9b1a0b359e774ae7d0b8d8eded63b80be8 Mon Sep 17 00:00:00 2001 From: Chintan Kavathia Date: Fri, 22 Nov 2024 17:46:33 +0530 Subject: [PATCH] chore: echo debug --- .github/workflows/test_and_deploy.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 24a55df5e..94ce43cd3 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -66,22 +66,27 @@ jobs: while [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; do sleep $CHECK_INTERVAL + echo "Polling for workflow status...$STATUS" + # Fetch latest workflow runs for Repository B RESPONSE=$(curl -s -H "Authorization: token $PAT" \ "https://api.github.com/repos/chintankavathia/siemens-datatable/actions/runs?branch=main&status=in_progress") - RUN_ID=$(echo $RESPONSE | jq -r '.workflow_runs[0].id') + T_RUN_ID=$(echo $RESPONSE | jq -r '.workflow_runs[0].id') STATUS=$(echo $RESPONSE | jq -r '.workflow_runs[0].status') + + if [ "$T_RUN_ID" !== null ]; then + RUN_ID=$T_RUN_ID + fi done - if [ "$STATUS" != "completed" ]; then - echo "Repository Siemens Datatable workflow failed or was cancelled" - exit 1 - fi + echo "Polling for workflow status...$RUN_ID" CONCLUSION=$(curl -s -H "Authorization: token $PAT" \ "https://api.github.com/repos/chintankavathia/siemens-datatable/actions/runs/$RUN_ID" | jq -r '.conclusion') + echo "Conclusion:: $CONCLUSION" + if [ "$CONCLUSION" != "success" ]; then echo "Repository Siemens Datatable workflow failed with conclusion: $CONCLUSION" exit 1