diff --git a/scripts/ci/post_benchmark_results.py b/scripts/ci/post_benchmark_results.py index 3efd5fcad..12492cf4f 100644 --- a/scripts/ci/post_benchmark_results.py +++ b/scripts/ci/post_benchmark_results.py @@ -71,9 +71,8 @@ def main(): benchmark_results = collect_benchmark_results(base_folder, pr_folder) pr_details = get_pr_details(REPO_OWNER, REPO_NAME, PR_NUMBER) - pr_body = pr_details.get('body', '') + pr_body = pr_details.get('body', '') or '' # if PR body is None, set it to empty string - markdown_table = create_markdown_table(benchmark_results) new_benchmark_section = f"\n## Benchmark Results\n{markdown_table}\n" @@ -85,7 +84,7 @@ def main(): flags=re.DOTALL ) else: - updated_body = f"{pr_body}\n\n{new_benchmark_section}" + updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section update_pr_description(REPO_OWNER, REPO_NAME, PR_NUMBER, updated_body) print("PR description updated successfully.")