Enable ignoring issues by author ID
This commit is contained in:
parent
8ffb3a1fc1
commit
9e85f28008
1 changed files with 7 additions and 3 deletions
|
@ -224,6 +224,7 @@ def maintain(config_path: Path, schedule: timedelta):
|
||||||
|
|
||||||
def _issue(subject, notif):
|
def _issue(subject, notif):
|
||||||
issue = client.get_issue(url=subject["url"])
|
issue = client.get_issue(url=subject["url"])
|
||||||
|
|
||||||
if issue["state"] == "closed":
|
if issue["state"] == "closed":
|
||||||
comments = client.get_comments(url=issue["comments_url"])
|
comments = client.get_comments(url=issue["comments_url"])
|
||||||
if not any(
|
if not any(
|
||||||
|
@ -231,6 +232,9 @@ def maintain(config_path: Path, schedule: timedelta):
|
||||||
):
|
):
|
||||||
_resolve(notif, "Unengaged issue closed")
|
_resolve(notif, "Unengaged issue closed")
|
||||||
|
|
||||||
|
if user["author"]["login"] in author_shitlist:
|
||||||
|
_resolve(notif, "Ignoring issue by author")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
savepoint = prev
|
savepoint = prev
|
||||||
|
@ -246,14 +250,14 @@ def maintain(config_path: Path, schedule: timedelta):
|
||||||
|
|
||||||
subject = notif["subject"]
|
subject = notif["subject"]
|
||||||
|
|
||||||
match subject["type"]:
|
match subject["type"].lower():
|
||||||
case "PullRequest":
|
case "pullrequest":
|
||||||
_pr(subject, notif)
|
_pr(subject, notif)
|
||||||
|
|
||||||
case "mention":
|
case "mention":
|
||||||
_mention(subject, notif)
|
_mention(subject, notif)
|
||||||
|
|
||||||
case "Issue":
|
case "issue":
|
||||||
_issue(subject, notif)
|
_issue(subject, notif)
|
||||||
|
|
||||||
duration = (tick - datetime.now(timezone.utc)).total_seconds()
|
duration = (tick - datetime.now(timezone.utc)).total_seconds()
|
||||||
|
|
Loading…
Reference in a new issue