From d3b7984a30ba4824ed13ce08333e76c8231e8e65 Mon Sep 17 00:00:00 2001 From: codex-bot-andresmgsl Date: Sun, 23 Aug 2026 17:41:10 +0000 Subject: [PATCH] fix: distinguish Forgejo mergeability states --- lib/forge-forgejo.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/forge-forgejo.sh b/lib/forge-forgejo.sh index 4331cc6..cfdf887 100644 --- a/lib/forge-forgejo.sh +++ b/lib/forge-forgejo.sh @@ -429,9 +429,12 @@ forge_pr_view() { status="$(forge_api "repos/$REPO/commits/$sha/status")" || return 1 jq -n --argjson pr "$pr" --argjson st "$status" ' { - mergeable: (if $pr.mergeable == true then "MERGEABLE" - elif $pr.mergeable == false then "CONFLICTING" - else "UNKNOWN" end), + # Forgejo folds checking, conflict, check error, and WIP into false. + # Draft must win because WIP makes the boolean carry no merge result (#236). + mergeable: (if $pr.draft == true then "UNKNOWN" + elif $pr.mergeable == true then "MERGEABLE" + elif $pr.merge_base == $pr.base.sha then "UNKNOWN" + else "CONFLICTING" end), statusCheckRollup: [ $st.statuses[]? | { __typename: "StatusContext",