From 53e3d3943f6a0824b7eab9614ff471222072418a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 10:13:08 +0000 Subject: [PATCH] Fix CleanUpStalePRChecks to handle UNKNOWN mergeable state Previously, the workflow only processed PRs in MERGEABLE state, skipping PRs where GitHub reports the mergeable state as UNKNOWN (which happens when mergeability hasn't been computed yet). Now the workflow only skips PRs with CONFLICTING state (actual merge conflicts), and processes PRs in both MERGEABLE and UNKNOWN states. Agent-Logs-Url: https://github.com/microsoft/BCApps/sessions/9253504e-b5c0-4cd7-90a0-cf30c897fbe3 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/CleanUpStalePRChecks/action.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/CleanUpStalePRChecks/action.ps1 b/.github/actions/CleanUpStalePRChecks/action.ps1 index 3278709600..ffed82c046 100644 --- a/.github/actions/CleanUpStalePRChecks/action.ps1 +++ b/.github/actions/CleanUpStalePRChecks/action.ps1 @@ -38,9 +38,10 @@ foreach ($pr in $prs) { Write-Host "" Write-Host "Checking PR #$($pr.number): $($pr.title)" - # Check if PR is mergeable - if ($pr.mergeable -ne "MERGEABLE") { - Write-Host " PR is not in MERGEABLE state (current: $($pr.mergeable)), skipping" + # Skip PRs with merge conflicts - they need manual resolution first + # Process PRs in MERGEABLE and UNKNOWN states (UNKNOWN means GitHub hasn't computed mergeability yet) + if ($pr.mergeable -eq "CONFLICTING") { + Write-Host " PR has merge conflicts (state: CONFLICTING), skipping" continue }