Added option to exclude other commits than the push commit.

This commit is contained in:
Marvin Pohl 2018-11-05 13:05:57 +01:00
parent df5fa87d2d
commit 4e0ce1f374
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,11 @@ class GiteaHandler(BaseHookHandler):
repo_url = repository['ssh_url'] repo_url = repository['ssh_url']
project = repository['full_name'] project = repository['full_name']
for commit in payload['commits']: commits = payload['commits']
if self.options.get('onlyIncludePushCommit', False):
commits = commits[:1]
for commit in commits:
timestamp = dateparse(commit['timestamp']) timestamp = dateparse(commit['timestamp'])
change = { change = {
'author': '{} <{}>'.format(commit['author']['name'], 'author': '{} <{}>'.format(commit['author']['name'],