From 3e16ba62b9e9acee5b1cef6aca31b0fa269eeb28 Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Wed, 25 Sep 2024 13:10:55 +0800 Subject: [PATCH] Fix duplicate test report in PR --- .github/workflows/report.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/report.py b/.github/workflows/report.py index d65eeefdaa..51a2e91d14 100644 --- a/.github/workflows/report.py +++ b/.github/workflows/report.py @@ -7,18 +7,20 @@ # Report to PR comment def report(report_dir, report_type): content = None - title = None + title_prefix = None if report_type == 'unit': - title = f"Unit test report" + title_prefix = f"Unit test report" elif report_type == 'integration': - title = f"Integration test report" + title_prefix = f"Integration test report" else: raise ValueError('Integration test report not available') - content = generate_report(report_dir, title) + title_prefix_copy = title_prefix + content = generate_report(report_dir, title_prefix) if content is not None: - comment_on_pr(content, title) + comment_on_pr(content, title_prefix_copy) + if __name__ == "__main__": report(sys.argv[1], sys.argv[2])