mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Merge b2376e8359 into 49affa7c01
This commit is contained in:
commit
2f00245011
1 changed files with 3 additions and 14 deletions
17
.github/scripts/close_duplicate_issues.py
vendored
17
.github/scripts/close_duplicate_issues.py
vendored
|
|
@ -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]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue