@@ -322,23 +322,24 @@ jobs:
322322 echo "❌ Re-render did not happen after 2 attempts — CI will fail without it"
323323 exit 1
324324
325- - name : Wait for checks
325+ - name : Wait for checks with auto-retry on failure
326326 if : env.skip_pr != 'true'
327327 env :
328328 GH_TOKEN : ${{ secrets.FEEDSTOCK_TOKEN }}
329329 run : |
330330 PR_NUMBER="${{ steps.create-pr.outputs.pull-request-number }}"
331331 REPO="conda-forge/omnipkg-feedstock"
332-
333- echo "⏳ Waiting for checks to start..."
334- sleep 120
335-
332+ echo "⏳ Waiting for checks..."
333+ sleep 180 # Wait a bit for initial triggers
334+
336335 ATTEMPT=0
337336 MAX_ATTEMPTS=60
338-
337+ RETRY_TRIGGERED=false
338+
339339 while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
340340 ATTEMPT=$((ATTEMPT + 1))
341-
341+
342+ # Count status check states
342343 PENDING=$(gh pr view $PR_NUMBER --repo $REPO \
343344 --json statusCheckRollup \
344345 --jq '[.statusCheckRollup[] | select(.status == "IN_PROGRESS" or .status == "PENDING" or .status == "QUEUED")] | length')
@@ -348,18 +349,28 @@ jobs:
348349 FAILED=$(gh pr view $PR_NUMBER --repo $REPO \
349350 --json statusCheckRollup \
350351 --jq '[.statusCheckRollup[] | select(.conclusion == "FAILURE")] | length')
351-
352- echo "📊 Attempt $ATTEMPT: $((TOTAL - PENDING))/$TOTAL done, $FAILED failed"
353-
354- if [ "$PENDING" -eq 0 ] && [ "$TOTAL" -gt 0 ]; then
355- if [ "$FAILED" -gt 0 ]; then
356- echo "❌ Some checks failed — leaving PR open for inspection"
357- exit 1
358- else
359- echo "✅ All checks passed!"
360- break
361- fi
352+
353+ echo "📊 Check status (Attempt $ATTEMPT): $((TOTAL - PENDING))/$TOTAL completed"
354+
355+ # If a job failed, trigger a single automated retry
356+ if [ "$FAILED" -gt 0 ] && [ "$RETRY_TRIGGERED" = "false" ]; then
357+ echo "⚠️ A check failed (likely a transient network error). Triggering automated CI restart..."
358+ gh pr comment $PR_NUMBER --repo $REPO --body "@conda-forge-admin, please restart ci"
359+ RETRY_TRIGGERED=true
360+ echo "⏳ Waiting 3 minutes for CI to reset and restart..."
361+ sleep 180
362+ continue
363+ elif [ "$FAILED" -gt 0 ] && [ "$RETRY_TRIGGERED" = "true" ] && [ "$PENDING" -eq 0 ]; then
364+ echo "❌ Checks failed even after automated restart. Aborting."
365+ gh pr view $PR_NUMBER --repo $REPO --json statusCheckRollup
366+ exit 1
367+ fi
368+
369+ if [ "$PENDING" -eq 0 ] && [ "$TOTAL" -gt 0 ] && [ "$FAILED" -eq 0 ]; then
370+ echo "✅ All checks passed successfully!"
371+ break
362372 fi
373+
363374 sleep 120
364375 done
365376
0 commit comments