Skip to content

Commit

Permalink
Set total_comments output if split_workflow is true
Browse files Browse the repository at this point in the history
Allows to set up the workflow to fail during the review stage instead
of posting stage if there are comments.
  • Loading branch information
BUYT-1 committed Sep 4, 2023
1 parent f411633 commit 10702a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions post/clang_tidy_review/clang_tidy_review/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
strip_enclosing_quotes,
post_annotations,
bool_argument,
set_output,
)


Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 10702a8

Please sign in to comment.