File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -346,8 +346,29 @@ jobs:
346346 run : |
347347 PR_NUMBER="${{ steps.version_pr.outputs.pr_number }}"
348348
349+ echo "Waiting for CI checks to be queued..."
350+ sleep 10
351+
349352 echo "Enabling auto-merge for PR #${PR_NUMBER}..."
350- gh pr merge "$PR_NUMBER" --auto --squash
353+
354+ # Retry auto-merge a few times in case checks aren't ready yet
355+ MAX_RETRIES=3
356+ RETRY=0
357+ while [ $RETRY -lt $MAX_RETRIES ]; do
358+ if gh pr merge "$PR_NUMBER" --auto --squash 2>&1; then
359+ echo "Auto-merge enabled successfully!"
360+ break
361+ else
362+ RETRY=$((RETRY + 1))
363+ if [ $RETRY -lt $MAX_RETRIES ]; then
364+ echo "Failed to enable auto-merge, retrying in 10 seconds... (attempt $RETRY/$MAX_RETRIES)"
365+ sleep 10
366+ else
367+ echo "Failed to enable auto-merge after $MAX_RETRIES attempts"
368+ exit 1
369+ fi
370+ fi
371+ done
351372
352373 echo "Waiting for PR to be merged..."
353374
You can’t perform that action at this time.
0 commit comments