From f6d4a214caa733a18be9616c7bbbc0fcc14967fc Mon Sep 17 00:00:00 2001 From: Ori Kotek Date: Thu, 13 Jul 2023 18:40:03 +0300 Subject: [PATCH] Github custom action development - WIP --- pr_agent/servers/github_action_runner.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 27b50433..171e9100 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -1,3 +1,4 @@ +import asyncio import json import os @@ -5,7 +6,7 @@ from pr_agent.config_loader import settings from pr_agent.tools.pr_reviewer import PRReviewer -def run_action(): +async def run_action(): GITHUB_EVENT_NAME = os.environ.get('GITHUB_EVENT_NAME', None) if not GITHUB_EVENT_NAME: print("GITHUB_EVENT_NAME not set") @@ -40,8 +41,8 @@ def run_action(): if action in ["opened", "reopened"]: pr_url = event_payload.get("pull_request", {}).get("url", None) if pr_url: - PRReviewer(pr_url).review() + await PRReviewer(pr_url).review() if __name__ == '__main__': - run_action() + asyncio.run(run_action())