Fix benchmark script for the case if PR has empty description

This commit is contained in:
Siarhei Fedartsou 2024-05-19 15:24:41 +02:00
parent dd43bac620
commit bd92bc2233

View File

@ -71,7 +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', '') or '' # if PR body is None, set it to empty string
# in both cases when there is no PR body or PR body is None fallback to empty string
pr_body = pr_details.get('body', '') or ''
markdown_table = create_markdown_table(benchmark_results)
new_benchmark_section = f"<!-- BENCHMARK_RESULTS_START -->\n## Benchmark Results\n{markdown_table}\n<!-- BENCHMARK_RESULTS_END -->"