From b774d10e0de300c7a53a88bf0be7f762ac4fb20d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 13 Jan 2026 17:44:01 +0000 Subject: [PATCH 1/3] Initial plan From 4d3aa562b45b363f74e08221b41ff5902463ca0d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 13 Jan 2026 17:50:16 +0000 Subject: [PATCH 2/3] Fix merge conflict detection by fetching individual PR details Co-authored-by: radical <1472+radical@users.noreply.github.com> --- .github/workflows/pr-review-needed.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-review-needed.yml b/.github/workflows/pr-review-needed.yml index 94875747550..bab625c64aa 100644 --- a/.github/workflows/pr-review-needed.yml +++ b/.github/workflows/pr-review-needed.yml @@ -78,8 +78,17 @@ jobs: continue; } + // Fetch the full PR details to get mergeable_state (not available in list endpoint) + const { data: fullPr } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: pr.number + }); + // Check if PR has merge conflicts - const hasMergeConflict = pr.mergeable_state === 'dirty'; + // mergeable_state can be: clean, dirty, blocked, unstable, unknown, or null + // We only mark as having conflicts if it's explicitly 'dirty' + const hasMergeConflict = fullPr.mergeable_state === 'dirty'; // Get reviews to check if PR is approved const reviews = await getAllPages(github.rest.pulls.listReviews, { From 34f00bd5753047fdce44bfefc6ea8659374bc3f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 13 Jan 2026 18:09:59 +0000 Subject: [PATCH 3/3] Improve merge conflict detection to handle all mergeable states Co-authored-by: radical <1472+radical@users.noreply.github.com> --- .github/workflows/pr-review-needed.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-review-needed.yml b/.github/workflows/pr-review-needed.yml index bab625c64aa..f36a675d752 100644 --- a/.github/workflows/pr-review-needed.yml +++ b/.github/workflows/pr-review-needed.yml @@ -86,9 +86,17 @@ jobs: }); // Check if PR has merge conflicts - // mergeable_state can be: clean, dirty, blocked, unstable, unknown, or null - // We only mark as having conflicts if it's explicitly 'dirty' - const hasMergeConflict = fullPr.mergeable_state === 'dirty'; + // mergeable_state can be: clean, dirty, blocked, behind, unstable, unknown, or null + // - 'dirty' definitely means conflicts + // - mergeable === false + not blocked/behind/unstable also likely means conflicts + // - blocked/behind/unstable mean the PR can't merge due to other reasons (checks, needs update, etc.) + const hasMergeConflict = fullPr.mergeable_state === 'dirty' || + (fullPr.mergeable === false && + fullPr.mergeable_state !== 'blocked' && + fullPr.mergeable_state !== 'behind' && + fullPr.mergeable_state !== 'unstable' && + fullPr.mergeable_state !== 'unknown' && + fullPr.mergeable_state !== 'clean'); // Get reviews to check if PR is approved const reviews = await getAllPages(github.rest.pulls.listReviews, {