await comment hiding

This commit is contained in:
pseusys
2023-02-26 09:34:04 +01:00
parent 2e2497e302
commit 1d2121e747
2 changed files with 3 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ async def main():
if GHM.update_readme(stats): if GHM.update_readme(stats):
DBM.g("Readme updated!") DBM.g("Readme updated!")
else: else:
GHM.push_to_pr(stats) await GHM.push_to_pr(stats)
DBM.g("Debug run, readme not updated. Check the latest comment for the generated stats.") DBM.g("Debug run, readme not updated. Check the latest comment for the generated stats.")
await DM.close_remote_resources() await DM.close_remote_resources()

View File

@@ -104,7 +104,7 @@ class GitHubManager:
return False return False
@staticmethod @staticmethod
def push_to_pr(stats: str): async def push_to_pr(stats: str):
""" """
Pushes readme data to current PR body instead of committing it. Pushes readme data to current PR body instead of committing it.
@@ -115,7 +115,7 @@ class GitHubManager:
pull_request = GitHubManager._GITHUB.get_repo("anmol098/waka-readme-stats").get_pull(EM.PR_NUMBER) pull_request = GitHubManager._GITHUB.get_repo("anmol098/waka-readme-stats").get_pull(EM.PR_NUMBER)
for comment in [ic for ic in pull_request.get_issue_comments() if ic.body.startswith(prefix)]: for comment in [ic for ic in pull_request.get_issue_comments() if ic.body.startswith(prefix)]:
DM.get_remote_graphql("hide_outdated_comment", id=comment.id) await DM.get_remote_graphql("hide_outdated_comment", id=comment.id)
pull_request.create_issue_comment(f"{prefix}\n\n{stats}") pull_request.create_issue_comment(f"{prefix}\n\n{stats}")
DBM.g("PR commented!") DBM.g("PR commented!")