Skip to content

Commit

Permalink
only get PR review info for actual PR events
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jan 6, 2024
1 parent 7a9ed4c commit 11c8831
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp_linter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def main():

rest_api_client = GithubApiClient()
logger.info("processing %s event", rest_api_client.event_name)
is_pr_event = rest_api_client.event_name == "pull_request"

# set logging verbosity
logger.setLevel(10 if args.verbosity or rest_api_client.debug_enabled else 20)
Expand Down Expand Up @@ -67,8 +68,8 @@ def main():
args.lines_changed_only,
args.database,
args.extra_arg,
args.tidy_review,
args.format_review,
is_pr_event and args.tidy_review,
is_pr_event and args.format_review,
)

start_log_group("Posting comment(s)")
Expand All @@ -81,8 +82,8 @@ def main():
args.step_summary,
args.file_annotations,
args.style,
args.format_review,
args.tidy_review,
is_pr_event and args.format_review,
is_pr_event and args.tidy_review,
)
end_log_group()

Expand Down

0 comments on commit 11c8831

Please sign in to comment.