@@ -312,10 +312,18 @@ jobs:
312312 echo "Mergeable: $MERGEABLE"
313313 echo "Merge State Status: $MERGE_STATE_STATUS"
314314
315- # Wait for mergeability check if still unknown
316- if [[ "$MERGEABLE" == "null" ]] || [[ "$MERGEABLE" == "UNKNOWN" ]]; then
317- echo "⏳ Mergeability check still in progress, waiting..."
318- sleep 10
315+ # Debug raw response to see what we're getting
316+ echo "DEBUG: Raw mergeable field: $(echo "$MERGEABLE_INFO" | jq -r '.data.repository.pullRequest.mergeable')"
317+ echo "DEBUG: Raw mergeStateStatus field: $(echo "$MERGEABLE_INFO" | jq -r '.data.repository.pullRequest.mergeStateStatus')"
318+
319+ # Wait for mergeability check if still unknown
320+ WAIT_COUNT=0
321+ MAX_WAITS=3
322+
323+ while [[ ("$MERGEABLE" == "null" || "$MERGEABLE" == "UNKNOWN" || "$MERGEABLE" == "MERGEABLE") && $WAIT_COUNT -lt $MAX_WAITS ]]; do
324+ WAIT_COUNT=$((WAIT_COUNT + 1))
325+ echo "⏳ Mergeability check still in progress, waiting... (attempt $WAIT_COUNT/$MAX_WAITS)"
326+ sleep 20
319327
320328 # Re-check mergeability
321329 MERGEABLE_INFO=$(gh api graphql \
@@ -336,7 +344,13 @@ jobs:
336344 MERGEABLE=$(echo "$MERGEABLE_INFO" | jq -r '.data.repository.pullRequest.mergeable')
337345 MERGE_STATE_STATUS=$(echo "$MERGEABLE_INFO" | jq -r '.data.repository.pullRequest.mergeStateStatus')
338346
339- echo "After wait - Mergeable: $MERGEABLE, Status: $MERGE_STATE_STATUS"
347+ echo "After wait $WAIT_COUNT - Mergeable: $MERGEABLE, Status: $MERGE_STATE_STATUS"
348+ echo "DEBUG: Raw mergeable after wait: $(echo "$MERGEABLE_INFO" | jq -r '.data.repository.pullRequest.mergeable')"
349+ done
350+
351+ # If still not resolved after max waits, show a warning but continue
352+ if [[ "$MERGEABLE" == "null" || "$MERGEABLE" == "UNKNOWN" || "$MERGEABLE" == "MERGEABLE" ]]; then
353+ echo "⚠️ Mergeability check did not complete after $MAX_WAITS attempts, proceeding anyway..."
340354 fi
341355
342356 # Check if PR is ready for merge queue
0 commit comments