From 4e0ce1f374d9c805e51e87111c430e8f5403374a Mon Sep 17 00:00:00 2001 From: Marvin Pohl Date: Mon, 5 Nov 2018 13:05:57 +0100 Subject: [PATCH] Added option to exclude other commits than the push commit. --- buildbot_gitea/webhook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildbot_gitea/webhook.py b/buildbot_gitea/webhook.py index 4625324..01ebbac 100644 --- a/buildbot_gitea/webhook.py +++ b/buildbot_gitea/webhook.py @@ -28,7 +28,11 @@ class GiteaHandler(BaseHookHandler): repo_url = repository['ssh_url'] 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']) change = { 'author': '{} <{}>'.format(commit['author']['name'],