1- import os
21import datetime
2+ import os
3+
34from github import Github
45
56REPO_NAME = "pytorch/executorch"
1718DAYS_BEFORE_CLOSE = 30
1819REMINDER_COOLDOWN_DAYS = 7 # Don't post another reminder within 7 days
1920
21+
2022def main ():
21- g = Github (os .environ [' GH_TOKEN' ])
23+ g = Github (os .environ [" GH_TOKEN" ])
2224 repo = g .get_repo (REPO_NAME )
2325
2426 print ("[VALIDATION] Would connect to Github and fetch repo:" , REPO_NAME )
@@ -44,16 +46,22 @@ def main():
4446 )
4547
4648 if not auto_comments :
47- if last_comment and (now - last_comment .created_at ).days >= DAYS_BEFORE_REMINDER :
49+ if (
50+ last_comment and (now - last_comment .created_at ).days >= DAYS_BEFORE_REMINDER
51+ ):
4852 user = issue .user .login
49- print (f"[VALIDATION] Would remind { user } on issue/PR #{ issue .number } " )
53+ print (
54+ f"[VALIDATION] Would remind { user } on issue/PR #{ issue .number } "
55+ )
5056
5157 elif auto_comments and not recent_auto_reminder :
5258 # Only post new reminder if last was > REMINDER_COOLDOWN_DAYS ago
5359 last_auto = auto_comments [- 1 ]
5460 user = issue .user .login
5561 if (now - last_auto .created_at ).days >= REMINDER_COOLDOWN_DAYS :
56- print (f"[VALIDATION] Would remind { user } again on issue/PR #{ issue .number } " )
62+ print (
63+ f"[VALIDATION] Would remind { user } again on issue/PR #{ issue .number } "
64+ )
5765
5866 # ---- EXISTING CLOSE/REMOVE LABEL LOGIC ----
5967 if auto_comments :
@@ -64,9 +72,13 @@ def main():
6472 )
6573 if not user_responded :
6674 if (now - last_auto .created_at ).days >= DAYS_BEFORE_CLOSE :
67- print (f"[VALIDATION] Would close issue/PR #{ issue .number } due to inactivity." )
75+ print (
76+ f"[VALIDATION] Would close issue/PR #{ issue .number } due to inactivity."
77+ )
6878 else :
69- print (f"[VALIDATION] Would remove label from issue/PR #{ issue .number } after user response." )
79+ print (
80+ f"[VALIDATION] Would remove label from issue/PR #{ issue .number } after user response."
81+ )
7082
7183if __name__ == "__main__" :
7284 main ()
0 commit comments