-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99ef7b8
commit 177f4f7
Showing
3 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import time | ||
|
||
from github import Github | ||
|
||
g = Github(os.environ.get("GITHUB_PAT")) | ||
issue_url = "https://github.com/wwzeng1/landing-page/issues/206" | ||
issue = g.get_repo("wwzeng1/landing-page").get_issue(206) | ||
|
||
comment_id = list(issue.get_comments())[0].id | ||
|
||
while True: | ||
comment = issue.get_comment(comment_id) | ||
body = comment.body | ||
start_time = time.time() | ||
print(f"Editing comment {comment_id}...") | ||
comment.edit(body=body.replace("- [ ] ↻ Restart Sweep", "- [x] ↻ Restart Sweep")) | ||
for i in range(60): | ||
comment = issue.get_comment(comment_id) | ||
print(f"Checking comment... ({time.time() - start_time:.2f})") | ||
if "- [ ] ↻ Restart Sweep" in comment.body: | ||
print(f"Got a response in {time.time() - start_time:.2f} seconds") | ||
break | ||
time.sleep(2) | ||
time.sleep(1) |