fix: distinguish Forgejo mergeability states
Some checks failed
labels / labels (pull_request) Failing after 20s
CI / test (pull_request) Has been cancelled
CI / release-exercise (pull_request) Has been cancelled
CI / self-guards (pull_request) Has been cancelled
CI / action-exercise (pull_request) Has been cancelled
CI / docs-sync-exercise (pull_request) Has been cancelled
Refs guard / refs-not-closing (pull_request) Has been cancelled
Some checks failed
labels / labels (pull_request) Failing after 20s
CI / test (pull_request) Has been cancelled
CI / release-exercise (pull_request) Has been cancelled
CI / self-guards (pull_request) Has been cancelled
CI / action-exercise (pull_request) Has been cancelled
CI / docs-sync-exercise (pull_request) Has been cancelled
Refs guard / refs-not-closing (pull_request) Has been cancelled
This commit is contained in:
parent
2029c9f520
commit
d3b7984a30
1 changed files with 6 additions and 3 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue