Skip to content

Commit 440ffc8

Browse files
authored
removed API calls in pending_user_response.py
1 parent 8d87136 commit 440ffc8

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.github/workflows/pending_user_response.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,22 @@
1717
DAYS_BEFORE_CLOSE = 30
1818

1919
def main():
20-
g = Github(os.environ['GH_TOKEN'])
21-
repo = g.get_repo(REPO_NAME)
20+
# g = Github(os.environ['GH_TOKEN'])
21+
# repo = g.get_repo(REPO_NAME)
22+
23+
print("[VALIDATION] Would connect to Github and fetch repo:", REPO_NAME)
24+
# issues = repo.get_issues(state='open', labels=[LABEL])
25+
print(f"[VALIDATION] Would fetch open issues with label '{LABEL}'.")
2226

23-
issues = repo.get_issues(state='open', labels=[LABEL])
2427
now = datetime.datetime.utcnow()
2528

29+
# Simulate issues for validation workflow
30+
issues = [] # Replace with mock issues if needed
31+
2632
for issue in issues:
27-
comments = list(issue.get_comments())
33+
# comments = list(issue.get_comments())
34+
print(f"[VALIDATION] Would fetch comments for issue/PR #{issue.number}.")
35+
comments = [] # Replace with mock comments if needed
2836
last_comment = comments[-1] if comments else None
2937

3038
# Find automation comments
@@ -36,8 +44,8 @@ def main():
3644
if last_comment and (now - last_comment.created_at).days >= DAYS_BEFORE_REMINDER:
3745
# Tag the issue author or PR author
3846
user = issue.user.login
39-
issue.create_comment(REMINDER_COMMENT.format(user))
40-
print(f"Reminded {user} on issue/PR #{issue.number}")
47+
# issue.create_comment(REMINDER_COMMENT.format(user))
48+
print(f"[VALIDATION] Would remind {user} on issue/PR #{issue.number}")
4149

4250
# Case 2: Automation comment exists, but no user response after 30 more days
4351
elif auto_comments:
@@ -50,15 +58,15 @@ def main():
5058

5159
if not user_responded:
5260
if (now - last_auto.created_at).days >= DAYS_BEFORE_CLOSE:
53-
issue.create_comment(CLOSE_COMMENT)
54-
issue.edit(state="closed")
55-
print(f"Closed issue/PR #{issue.number} due to inactivity.")
61+
# issue.create_comment(CLOSE_COMMENT)
62+
# issue.edit(state="closed")
63+
print(f"[VALIDATION] Would close issue/PR #{issue.number} due to inactivity.")
5664

5765
else:
5866
# Remove label if user responded
5967
labels = [l.name for l in issue.labels if l.name != LABEL]
60-
issue.set_labels(*labels)
61-
print(f"Removed label from issue/PR #{issue.number} after user response.")
68+
# issue.set_labels(*labels)
69+
print(f"[VALIDATION] Would remove label from issue/PR #{issue.number} after user response.")
6270

6371
if __name__ == "__main__":
6472
main()

0 commit comments

Comments
 (0)