From 10702a80c3af6c4cc1e234de164ba6fa53a41f98 Mon Sep 17 00:00:00 2001 From: BUYT-1 <59949541+BUYT-1@users.noreply.github.com> Date: Mon, 4 Sep 2023 20:55:51 +0300 Subject: [PATCH] Set total_comments output if split_workflow is true Allows to set up the workflow to fail during the review stage instead of posting stage if there are comments. --- post/clang_tidy_review/clang_tidy_review/review.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/post/clang_tidy_review/clang_tidy_review/review.py b/post/clang_tidy_review/clang_tidy_review/review.py index 007d4b3..556b2e9 100755 --- a/post/clang_tidy_review/clang_tidy_review/review.py +++ b/post/clang_tidy_review/clang_tidy_review/review.py @@ -20,6 +20,7 @@ strip_enclosing_quotes, post_annotations, bool_argument, + set_output, ) @@ -158,6 +159,8 @@ def main(): save_metadata(args.pr) if args.split_workflow: + total_comments = 0 if review is None else len(review["comments"]) + set_output("total_comments", total_comments) print("split_workflow is enabled, not posting review") return