Skip to content

Commit

Permalink
Add set_summary helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed May 23, 2024
1 parent f081186 commit 3a8186f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion post/clang_tidy_review/clang_tidy_review/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ def create_review(
# Post to the action job summary
step_summary = "summary"
# step_summary += make_timing_summary(clang_tidy_profiling)
set_output("GITHUB_STEP_SUMMARY", step_summary)
set_summary(step_summary)

print("clang-tidy had the following warnings:\n", clang_tidy_warnings, flush=True)

Expand Down Expand Up @@ -1179,6 +1179,17 @@ def set_output(key: str, val: str) -> bool:
return True


def set_summary(val: str) -> bool:
if "GITHUB_STEP_SUMMARY" not in os.environ:
return False

# append key-val pair to file
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as f:
f.write(val)

return True


def decorate_comment_body(comment: str) -> str:
"""
Split on first dash into two groups of string in [] at end of line
Expand Down

0 comments on commit 3a8186f

Please sign in to comment.