Added option to exclude other commits than the push commit.
This commit is contained in:
parent
df5fa87d2d
commit
4e0ce1f374
|
@ -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'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user