Skip to content

Commit

Permalink
Handle check suite for first commit
Browse files Browse the repository at this point in the history
The update provides a specific handler for a check suite in case of the first commit. Now, if the 'before' field of check suite equals to "0000000000000000000000000000000000000000", meaning it's the first commit, the code will set check run's title to "First commit", its conclusion to success, and then return.

[release:minor]
  • Loading branch information
heitorpolidoro committed Jul 2, 2024
1 parent 173449c commit bb173de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/managers/release_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def manage(event: CheckSuiteRequestedEvent) -> None:
version_to_release = None
check_suite = event.check_suite
is_default_branch = head_branch == repository.default_branch
if check_suite.before == "0000000000000000000000000000000000000000":
check_run.update(title="First commit", conclusion=CheckRunConclusion.SUCCESS)
return
if is_default_branch:
commits = repository.compare(check_suite.before, check_suite.after).commits.reversed
else:
Expand Down

0 comments on commit bb173de

Please sign in to comment.