File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -564,15 +564,24 @@ echo >&2 "0d. Merging NoAct PR1 (without action installed)..."
564564merge_pr_with_retry " $NOACT_PR1_URL "
565565echo >&2 " NoAct PR1 merged. Branch should be auto-deleted and PR2 auto-retargeted."
566566
567- # Debug: Check if the branch was actually deleted
568- echo >&2 " Checking if noact_feature1 branch was deleted..."
569- if gh api " /repos/$REPO_FULL_NAME /branches/noact_feature1" & > /dev/null; then
570- echo >&2 " ❌ Branch noact_feature1 still exists! Auto-delete may not have worked."
567+ # Wait for GitHub to delete the branch (async operation)
568+ echo >&2 " Waiting for noact_feature1 branch to be deleted..."
569+ branch_deleted=false
570+ for attempt in {1..10}; do
571+ if ! gh api " /repos/$REPO_FULL_NAME /branches/noact_feature1" & > /dev/null; then
572+ echo >&2 " ✅ Branch noact_feature1 was deleted (attempt $attempt )."
573+ branch_deleted=true
574+ break
575+ fi
576+ echo >&2 " Attempt $attempt /10: Branch still exists, waiting..."
577+ sleep 2
578+ done
579+
580+ if [[ " $branch_deleted " != " true" ]]; then
581+ echo >&2 " ❌ Branch noact_feature1 still exists after 10 attempts!"
571582 echo >&2 " Repo settings:"
572583 gh api " /repos/$REPO_FULL_NAME " --jq ' {delete_branch_on_merge}' >&2
573584 exit 1
574- else
575- echo >&2 " ✅ Branch noact_feature1 was deleted."
576585fi
577586
578587# Wait for GitHub to auto-retarget PR2 to main
You can’t perform that action at this time.
0 commit comments