Merge pull request #1253 from Codium-ai/tr/code_suggestion_message

Add configuration for auto actions in GitHub Action runner
This commit is contained in:
Tal
2024-09-26 08:50:56 +03:00
committed by GitHub

View File

@ -80,7 +80,7 @@ async def run_action():
except Exception as e: except Exception as e:
get_logger().info(f"github action: failed to apply repo settings: {e}") get_logger().info(f"github action: failed to apply repo settings: {e}")
# Handle pull request event # Handle pull request opened event
if GITHUB_EVENT_NAME == "pull_request": if GITHUB_EVENT_NAME == "pull_request":
action = event_payload.get("action") action = event_payload.get("action")
@ -101,9 +101,13 @@ 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)
# Set the configuration for auto actions
get_settings().config.is_auto_command = True # Set the flag to indicate that the command is auto
get_settings().pr_description.final_update_message = False # No final update message when auto_describe is enabled
get_logger().info(f"Running auto actions: auto_describe={auto_describe}, auto_review={auto_review}, auto_improve={auto_improve}")
# invoke by default all three tools # 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
await PRDescription(pr_url).run() await PRDescription(pr_url).run()
if auto_review is None or is_true(auto_review): if auto_review is None or is_true(auto_review):
await PRReviewer(pr_url).run() await PRReviewer(pr_url).run()