From eb0caee0ad1eb68ccb377d40f3e6178a7544178d Mon Sep 17 00:00:00 2001 From: Larry Liu Date: Thu, 23 Jan 2025 15:37:24 -0800 Subject: [PATCH] Fix the polling script. --- scripts/indexer_proto_update_status_poll.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/indexer_proto_update_status_poll.sh b/scripts/indexer_proto_update_status_poll.sh index d547dd7f8bfd8..88741b8c1c070 100755 --- a/scripts/indexer_proto_update_status_poll.sh +++ b/scripts/indexer_proto_update_status_poll.sh @@ -3,7 +3,7 @@ # PAT_TOKEN and TARGET_BRANCH are passed in as environment variables. TARGET_REPO="aptos-labs/aptos-indexer-processors" -WORKFLOW_NAME="sdk-dependency-update" +WORKFLOW_NAME="lint.yaml" MAX_RETRIES=30 RETRY_INTERVAL=60 # seconds @@ -22,11 +22,13 @@ for ((i=1; i<=MAX_RETRIES; i++)); do # Check the latest completed run for the branch response=$(curl -s -H "Authorization: token $PAT_TOKEN" \ "https://api.github.com/repos/$TARGET_REPO/actions/workflows/$WORKFLOW_NAME/runs?branch=$TARGET_BRANCH&status=completed") + echo "$response" total_count=$(echo "$response" | jq -r '.total_count') if [ "$total_count" -gt 0 ]; then conclusion=$(echo "$response" | jq -r '.workflow_runs[0].conclusion') else echo "No workflow runs found for branch $TARGET_BRANCH" + sleep $RETRY_INTERVAL continue fi # If the workflow succeeds, exit with a zero status