Answer stability round 2: 1 🔴, 0 🟡 (0 misread); match Gitea pull requests by head label, which survives origin deleting a merged branch

This commit is contained in:
2026-11-10 11:13:26 +01:00
parent 67c7c979a0
commit 23b7848be6
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ def merge(number, guard):
opened = [found for found in state["pulls"] if found["state"] == "open"]
if forge == "tea" and args == ["api", "repos/{owner}/{repo}/pulls?state=open&limit=50"]:
repo = lambda found: {"full_name": "fork/r" if found["fork"] else "o/r"}
print(json.dumps([{"number": found["number"], "head": {"ref": found["head"], "sha": sha(found), "repo": repo(found)}, "base": {"repo": {"full_name": "o/r"}}} for found in opened]))
print(json.dumps([{"number": found["number"], "head": {"ref": found["head"], "label": found["head"], "sha": sha(found), "repo": repo(found)}, "base": {"repo": {"full_name": "o/r"}}} for found in opened]))
elif forge == "gh" and args[:3] == ["pr", "list", "--head"] and args[4:6] == ["--json", "number,headRefOid,isCrossRepository"]:
for found in opened:
if found["head"] == args[3]: