From 306af02d2285a13a54e7b05aad369a38dab8090c Mon Sep 17 00:00:00 2001 From: Matan Baruch <36934912+matanbaruch@users.noreply.github.com> Date: Sun, 15 Sep 2024 09:42:02 +0300 Subject: [PATCH] Update github_action_runner.py --- pr_agent/servers/github_action_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 417e8154..bdd4f5cf 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -54,6 +54,7 @@ async def run_action(): if OPENAI_KEY: get_settings().set("OPENAI.KEY", OPENAI_KEY) else: + # Might not be set if the user is using models not from OpenAI print("OPENAI_KEY not set") if OPENAI_ORG: get_settings().set("OPENAI.ORG", OPENAI_ORG) @@ -89,6 +90,7 @@ async def run_action(): if action in pr_actions: pr_url = event_payload.get("pull_request", {}).get("url") if pr_url: + # legacy - supporting both GITHUB_ACTION and GITHUB_ACTION_CONFIG auto_review = get_setting_or_env("GITHUB_ACTION.AUTO_REVIEW", None) if auto_review is None: auto_review = get_setting_or_env("GITHUB_ACTION_CONFIG.AUTO_REVIEW", None) @@ -99,6 +101,7 @@ async def run_action(): if auto_improve is None: auto_improve = get_setting_or_env("GITHUB_ACTION_CONFIG.AUTO_IMPROVE", None) + # invoke by default all three tools if auto_describe is None or is_true(auto_describe): get_settings().pr_description.final_update_message = False # No final update message when auto_describe is enabled await PRDescription(pr_url).run() @@ -128,7 +131,7 @@ async def run_action(): if event_payload.get("issue", {}).get("pull_request"): url = event_payload.get("issue", {}).get("pull_request", {}).get("url") is_pr = True - elif event_payload.get("comment", {}).get("pull_request_url"): + elif event_payload.get("comment", {}).get("pull_request_url"): # for 'pull_request_review_comment url = event_payload.get("comment", {}).get("pull_request_url") is_pr = True disable_eyes = True