mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
Update github_action_runner.py
This commit is contained in:
@ -54,6 +54,7 @@ async def run_action():
|
|||||||
if OPENAI_KEY:
|
if OPENAI_KEY:
|
||||||
get_settings().set("OPENAI.KEY", OPENAI_KEY)
|
get_settings().set("OPENAI.KEY", OPENAI_KEY)
|
||||||
else:
|
else:
|
||||||
|
# Might not be set if the user is using models not from OpenAI
|
||||||
print("OPENAI_KEY not set")
|
print("OPENAI_KEY not set")
|
||||||
if OPENAI_ORG:
|
if OPENAI_ORG:
|
||||||
get_settings().set("OPENAI.ORG", OPENAI_ORG)
|
get_settings().set("OPENAI.ORG", OPENAI_ORG)
|
||||||
@ -89,6 +90,7 @@ async def run_action():
|
|||||||
if action in pr_actions:
|
if action in pr_actions:
|
||||||
pr_url = event_payload.get("pull_request", {}).get("url")
|
pr_url = event_payload.get("pull_request", {}).get("url")
|
||||||
if pr_url:
|
if pr_url:
|
||||||
|
# legacy - supporting both GITHUB_ACTION and GITHUB_ACTION_CONFIG
|
||||||
auto_review = get_setting_or_env("GITHUB_ACTION.AUTO_REVIEW", None)
|
auto_review = get_setting_or_env("GITHUB_ACTION.AUTO_REVIEW", None)
|
||||||
if auto_review is None:
|
if auto_review is None:
|
||||||
auto_review = get_setting_or_env("GITHUB_ACTION_CONFIG.AUTO_REVIEW", 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:
|
if auto_improve is None:
|
||||||
auto_improve = get_setting_or_env("GITHUB_ACTION_CONFIG.AUTO_IMPROVE", 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):
|
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
|
get_settings().pr_description.final_update_message = False # No final update message when auto_describe is enabled
|
||||||
await PRDescription(pr_url).run()
|
await PRDescription(pr_url).run()
|
||||||
@ -128,7 +131,7 @@ async def run_action():
|
|||||||
if event_payload.get("issue", {}).get("pull_request"):
|
if event_payload.get("issue", {}).get("pull_request"):
|
||||||
url = event_payload.get("issue", {}).get("pull_request", {}).get("url")
|
url = event_payload.get("issue", {}).get("pull_request", {}).get("url")
|
||||||
is_pr = True
|
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")
|
url = event_payload.get("comment", {}).get("pull_request_url")
|
||||||
is_pr = True
|
is_pr = True
|
||||||
disable_eyes = True
|
disable_eyes = True
|
||||||
|
Reference in New Issue
Block a user