Skip to content

Commit

Permalink
Update check-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kdivya153 authored Oct 21, 2024
1 parent 9cb3c3c commit 98755f3
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,34 @@ jobs:
REPO_NAME="firebolt-apis"
WORKFLOW_NAME="MFOS standalone sanity report - CORE,MANAGE,DISCOVERY"
# Poll for the latest workflow run in Repo2
while true; do
response=$(curl -s -H "Authorization: token $TOKEN" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows" | jq \
--arg WORKFLOW_NAME "$WORKFLOW_NAME" \
'.workflows[] | select(.name == $WORKFLOW_NAME)')
workflow_id=$(echo $response | jq -r '.id')
if [ "$workflow_id" == "null" ]; then
echo "Workflow not found, retrying..."
echo "Workflow not found, retrying in 10 seconds..."
sleep 10
continue
fi
# Get the latest workflow run
run_response=$(curl -s -H "Authorization: token $TOKEN" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows/$workflow_id/runs?status=completed&per_page=1")
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows/$workflow_id/runs?per_page=1")
status=$(echo $run_response | jq -r '.workflow_runs[0].status')
conclusion=$(echo $run_response | jq -r '.workflow_runs[0].conclusion')
if [ "$conclusion" == "success" ]; then
if [ "$status" == "completed" ] && [ "$conclusion" == "success" ]; then
echo "JavaScript SDK generated successfully."
break
elif [ "$conclusion" == "failure" ]; then
echo "Failing to generate JavaScript SDK with the following OPENRPC changes"
elif [ "$status" == "completed" ] && [ "$conclusion" == "failure" ]; then
echo "Failed to generate JavaScript SDK."
exit 1
else
echo " still in progress. Checking again in 120 seconds..."
echo "Still in progress. Checking again in 120 seconds..."
sleep 120
fi
done
Expand All @@ -89,32 +90,34 @@ jobs:
REPO_NAME="firebolt-apis"
WORKFLOW_NAME="CXX Build"
# Poll for the latest workflow run in Repo2
while true; do
response=$(curl -s -H "Authorization: token $TOKEN" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows" | jq \
--arg WORKFLOW_NAME "$WORKFLOW_NAME" \
'.workflows[] | select(.name == $WORKFLOW_NAME)')
workflow_id=$(echo $response | jq -r '.id')
if [ "$workflow_id" == "null" ]; then
echo "Workflow not found, retrying..."
echo "Workflow not found, retrying in 10 seconds..."
sleep 10
continue
fi
# Get the latest workflow run
run_response=$(curl -s -H "Authorization: token $TOKEN" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows/$workflow_id/runs?status=completed&per_page=1")
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/actions/workflows/$workflow_id/runs?per_page=1")
status=$(echo $run_response | jq -r '.workflow_runs[0].status')
conclusion=$(echo $run_response | jq -r '.workflow_runs[0].conclusion')
if [ "$conclusion" == "success" ]; then
echo "CPP SDK generated successfully ."
if [ "$status" == "completed" ] && [ "$conclusion" == "success" ]; then
echo "CPP SDK generated successfully."
break
elif [ "$conclusion" == "failure" ]; then
echo "Warning:: Failing to generate CPP SDK with the following OPENRPC changes"
elif [ "$status" == "completed" ] && [ "$conclusion" == "failure" ]; then
echo "Failed to generate CPP SDK."
exit 1
else
echo " still in progress. Checking again in 120 seconds..."
echo "Still in progress. Checking again in 120 seconds..."
sleep 120
fi
done

0 comments on commit 98755f3

Please sign in to comment.