fix: distinguish Forgejo mergeability states #242

Merged
andres merged 3 commits from codex-bot-andresmgsl/ceremony:build/236-forgejo-mergeable into main 2026-08-23 22:52:09 +00:00
Showing only changes of commit d3b7984a30 - Show all commits

View file

@ -429,9 +429,12 @@ forge_pr_view() {
status="$(forge_api "repos/$REPO/commits/$sha/status")" || return 1 status="$(forge_api "repos/$REPO/commits/$sha/status")" || return 1
jq -n --argjson pr "$pr" --argjson st "$status" ' jq -n --argjson pr "$pr" --argjson st "$status" '
{ {
mergeable: (if $pr.mergeable == true then "MERGEABLE" # Forgejo folds checking, conflict, check error, and WIP into false.
elif $pr.mergeable == false then "CONFLICTING" # Draft must win because WIP makes the boolean carry no merge result (#236).
else "UNKNOWN" end), 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: [ statusCheckRollup: [
$st.statuses[]? | { $st.statuses[]? | {
__typename: "StatusContext", __typename: "StatusContext",