From 1d2121e7473f331ce8b3ae577fdaabaec72a176c Mon Sep 17 00:00:00 2001 From: pseusys Date: Sun, 26 Feb 2023 09:34:04 +0100 Subject: [PATCH] await comment hiding --- sources/main.py | 2 +- sources/manager_github.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/main.py b/sources/main.py index 648c72a..21347b2 100644 --- a/sources/main.py +++ b/sources/main.py @@ -190,7 +190,7 @@ async def main(): if GHM.update_readme(stats): DBM.g("Readme updated!") 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.") await DM.close_remote_resources() diff --git a/sources/manager_github.py b/sources/manager_github.py index f57033c..45ed276 100644 --- a/sources/manager_github.py +++ b/sources/manager_github.py @@ -104,7 +104,7 @@ class GitHubManager: return False @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. @@ -115,7 +115,7 @@ class GitHubManager: 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)]: - 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}") DBM.g("PR commented!")