fix: distinguish Forgejo mergeability states

This commit is contained in:
codex-bot-andresmgsl 2026-08-23 17:41:10 +00:00
parent 2029c9f520
commit d3b7984a30

View file

@ -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",