Skip bitbucket pushes without any commits

Fixes 178220183/
This commit is contained in:
Joseph Schorr 2017-03-20 18:23:21 -04:00
parent 4cb8412fd8
commit 6476488221
4 changed files with 90 additions and 2 deletions

View file

@ -12,6 +12,7 @@ from buildtrigger.basehandler import BuildTriggerHandler
from buildtrigger.triggerutil import (RepositoryReadException, TriggerActivationException,
TriggerDeactivationException, TriggerStartException,
InvalidPayloadException, TriggerProviderException,
SkipRequestException,
determine_build_ref, raise_if_skipped_build,
find_matching_branches)
from util.dict_wrappers import JSONPathDict, SafeDictSetter
@ -226,7 +227,7 @@ def get_transformed_webhook_payload(bb_payload, default_branch=None):
payload = JSONPathDict(bb_payload)
change = payload['push.changes[-1].new']
if not change:
return None
raise SkipRequestException
is_branch = change['type'] == 'branch'
ref = 'refs/heads/' + change['name'] if is_branch else 'refs/tags/' + change['name']