File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717"""
1818import os
1919from datetime import datetime as dt
20+ from datetime import timezone
2021
2122from github import Github
2223
@@ -43,8 +44,8 @@ def main():
4344 if (
4445 last_comment is not None
4546 and last_comment .user .login == "github-actions[bot]"
46- and (dt .utcnow ( ) - issue .updated_at ).days > 7
47- and (dt .utcnow ( ) - issue .created_at ).days >= 30
47+ and (dt .now ( timezone . utc ) - issue .updated_at ).days > 7
48+ and (dt .now ( timezone . utc ) - issue .created_at ).days >= 30
4849 and not any (label .name .lower () in LABELS_TO_EXEMPT for label in issue .get_labels ())
4950 ):
5051 # Closes the issue after 7 days of inactivity since the Stalebot notification.
@@ -58,8 +59,8 @@ def main():
5859 issue .edit (state = "open" )
5960 issue .remove_from_labels ("stale" )
6061 elif (
61- (dt .utcnow ( ) - issue .updated_at ).days > 23
62- and (dt .utcnow ( ) - issue .created_at ).days >= 30
62+ (dt .now ( timezone . utc ) - issue .updated_at ).days > 23
63+ and (dt .now ( timezone . utc ) - issue .created_at ).days >= 30
6364 and not any (label .name .lower () in LABELS_TO_EXEMPT for label in issue .get_labels ())
6465 ):
6566 # Post a Stalebot notification after 23 days of inactivity.
You can’t perform that action at this time.
0 commit comments