@tomtaylor@walf443@bpot@frsyuki@mscdex
#!/usr/bin/env python3importrequestsREST_URL="https://api.github.com"OWNER="YOUR_OWNER"REPO="YOUR_REPO_NAME"TOKEN="YOUR_GITHUB_TOKEN"HEADERS= {
"Authorization": f"Bearer {TOKEN}",
"Accept": "application/vnd.github+json",
"Content-Type": "application/json"
}
defclose_issue(owner: str, repo: str, issue_number: int) ->bool:
try:
response=requests.patch(
f"{REST_URL}/repos/{owner}/{repo}/issues/{issue_number}",
headers=HEADERS,
json={"state": "closed"},
timeout=30
)
returnresponse.status_code==200exceptrequests.exceptions.RequestException:
returnFalsedeflist_issues() ->list:
response=requests.get(
f"{REST_URL}/search/issues?q=repo:{OWNER}/{REPO}%20%22%E6%89%A3%EF%BC%9A63923%22%20OR%20%22%EF%BC%98%20%EF%BC%97%20%EF%BC%92%20%EF%BC%96%20%C2%B7%20%EF%BC%A3%20%EF%BC%A3%22%20OR%20%223764%20%C2%B7%20CC%22%20OR%20%22%EF%BC%92%EF%BC%90%EF%BC%92%EF%BC%96%E4%B8%96%E7%95%8C%E6%9D%AF%EF%BC%8C%E7%90%83%E8%BF%B7%E7%8B%82%E6%AC%A2%EF%BC%81%22%20OR%20%22%E6%89%A3:%2063923%22%20created:2026-03-27..2026-03-29",
headers=HEADERS,
timeout=30
)
returnresponse.json()["items"]
if__name__=="__main__":
issues=list_issues()
forissueinissues:
print(issue["number"], issue["title"])
close_issue(OWNER, REPO, issue["number"])
This patch was developed by a Chinese developer.
I don't have the permission, so I can't test it. I hope it works well.
@tomtaylor@walf443@bpot@frsyuki@mscdex
This patch was developed by a Chinese developer.
I don't have the permission, so I can't test it. I hope it works well.