Skip to content

Commit

Permalink
src/webhooks.py: Ignore pushes with zero commits
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Sep 20, 2024
1 parent d285ec4 commit dafe0ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ async def push(self, payload: ClientPayload):
await updates_channel.send(
f"{name} {pushed} a commit{by_statement} to {branch} in {repo} ({compare}): {message}",
)
else:
# ignore webhooks with zero commits
elif commit_count > 1:
formatted_commits = [
f"* [`{commit['id'][:7]}`]({self.url(commit)}): \"{self.natural_wrap(commit['message'])[:100]}\""
for commit in gh["commits"]
Expand Down

0 comments on commit dafe0ad

Please sign in to comment.