diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-01 20:51:26 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-01 21:13:14 -0500 |
commit | b1debdd7614d52b0476f4e4668f59011a06de15f (patch) | |
tree | cc8412d5928f46ff245e647c7bf932a9ab3b034d /ci | |
parent | 2551a2becf8520d9c3624247d7c40dfb7f1f0c48 (diff) | |
download | python-coveragepy-git-b1debdd7614d52b0476f4e4668f59011a06de15f.tar.gz |
build: version bump and more release details
Diffstat (limited to 'ci')
-rw-r--r-- | ci/comment_on_fixes.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ci/comment_on_fixes.py b/ci/comment_on_fixes.py index b76a6cda..f36cba93 100644 --- a/ci/comment_on_fixes.py +++ b/ci/comment_on_fixes.py @@ -2,7 +2,6 @@ import json import re -import time import requests @@ -23,10 +22,14 @@ for m in re.finditer(r"https://github.com/nedbat/coveragepy/(issues|pull)/(\d+)" kind, number = m.groups() if kind == "issues": - print(f"Commenting on {m[0]}") - url = f"https://api.github.com/repos/{owner}/{repo}/issues/{number}/comments" - resp = requests.post(url, json={"body": comment}) - print(resp) - time.sleep(1) + url = f"https://api.github.com/repos/{owner}/{repo}/issues/{number}" + issue_data = requests.get(url).json() + if issue_data["state"] == "closed": + print(f"Commenting on {m[0]}") + url = f"https://api.github.com/repos/{owner}/{repo}/issues/{number}/comments" + resp = requests.post(url, json={"body": comment}) + print(resp) + else: + print(f"Still open, comment manually: {m[0]}") else: print(f"You need to manually coment on {m[0]}") |