From 4ba525f12a842beafe199b12ecc0c433f6135ca9 Mon Sep 17 00:00:00 2001 From: Daniel Genis Date: Thu, 7 Sep 2023 13:15:51 +0200 Subject: [PATCH 1/3] feat: run analysis also on ready_for_review, synchronize events --- pr_agent/servers/github_action_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index fbf4f89c9..6246ac9f5 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -50,7 +50,7 @@ async def run_action(): # Handle pull request event if GITHUB_EVENT_NAME == "pull_request": action = event_payload.get("action") - if action in ["opened", "reopened"]: + if action in ["opened", "reopened", "synchronize", "ready_for_review"]: pr_url = event_payload.get("pull_request", {}).get("url") if pr_url: await PRReviewer(pr_url).run() @@ -70,4 +70,4 @@ async def run_action(): if __name__ == '__main__': - asyncio.run(run_action()) \ No newline at end of file + asyncio.run(run_action()) From a987183a6520994043823ffd9eedb37bfca38ad5 Mon Sep 17 00:00:00 2001 From: Daniel Genis Date: Thu, 7 Sep 2023 14:24:04 +0200 Subject: [PATCH 2/3] add debug statements --- pr_agent/servers/github_action_runner.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 6246ac9f5..fcc8f42d9 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -47,17 +47,21 @@ async def run_action(): print(f"Failed to parse JSON: {e}") return + print('handling ' + GITHUB_EVENT_NAME + ' event') # Handle pull request event if GITHUB_EVENT_NAME == "pull_request": action = event_payload.get("action") + print('handling ' + action + ' action') if action in ["opened", "reopened", "synchronize", "ready_for_review"]: pr_url = event_payload.get("pull_request", {}).get("url") if pr_url: + print('doing review of pr url:' + pr_url) await PRReviewer(pr_url).run() # Handle issue comment event elif GITHUB_EVENT_NAME == "issue_comment": action = event_payload.get("action") + print('handling ' + action + ' action') if action in ["created", "edited"]: comment_body = event_payload.get("comment", {}).get("body") if comment_body: From 712f0ff0c37b71c676398f73c6ea0198eb9cdd03 Mon Sep 17 00:00:00 2001 From: Daniel Genis Date: Thu, 7 Sep 2023 14:25:47 +0200 Subject: [PATCH 3/3] fix: run own code from this repo --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 85d55e4e1..bacb453cf 100644 --- a/action.yaml +++ b/action.yaml @@ -5,4 +5,4 @@ branding: color: 'green' runs: using: 'docker' - image: 'Dockerfile.github_action_dockerhub' + image: 'Dockerfile.github_action'