[mod] cap number of commits shown in push

This commit is contained in:
Laurent Peuch 2019-02-06 12:39:54 +01:00
parent 13d417d5e3
commit e136c96333

View file

@ -65,7 +65,7 @@ async def github(request):
else: else:
url = request.json["compare"] url = request.json["compare"]
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}") notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")
for commit in commits: for commit in commits[-5:]:
author = commit["author"]["name"] author = commit["author"]["name"]
commit_message = commit["message"] commit_message = commit["message"]
notify(f"[{repository}/{branch}] {commit_message} - {author}") notify(f"[{repository}/{branch}] {commit_message} - {author}")