From 1c51b5b762931014baac04133cb635b832d4ce94 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 30 Aug 2024 09:12:22 -0400 Subject: [PATCH] Fixing code suggestions being published if there are no code suggestions when publish output is false --- pr_agent/tools/pr_code_suggestions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index 7bef80d15..f374a08f4 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -104,7 +104,8 @@ async def run(self): if not data: data = {"code_suggestions": []} - if data is None or 'code_suggestions' not in data or not data['code_suggestions']: + if (data is None or 'code_suggestions' not in data or not data['code_suggestions'] + and get_settings().config.publish_output): get_logger().warning('No code suggestions found for the PR.') pr_body = "## PR Code Suggestions ✨\n\nNo code suggestions found for the PR." get_logger().debug(f"PR output", artifact=pr_body)