This commit is contained in:
cursor[bot] 2026-08-27 18:35:56 -05:00 • committed by GitHub
commit 2f00245011
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,22 +47,11 @@ def fetch_open_issues(repo: str | None) -> list[dict]:
)
else:
endpoint = "repos/{owner}/{repo}/issues?state=open&per_page=100&sort=created&direction=asc"
cmd = ["api", "--paginate", endpoint]
raw = gh(*cmd)
# gh --paginate concatenates JSON arrays, so we may get multiple arrays
issues = []
for line in raw.strip().splitlines():
line = line.strip()
if not line:
continue
parsed = json.loads(line)
if isinstance(parsed, list):
issues.extend(parsed)
else:
issues.append(parsed)
raw = gh("api", "--paginate", endpoint, "--jq", ".[]")
issues = [json.loads(line) for line in raw.splitlines() if line.strip()]
# Filter out pull requests (they also appear in the issues endpoint)
return [i for i in issues if "pull_request" not in i]