Merge pull request #2126 from coreos-inc/github-empty

Fix github trigger when submitting a webhook without a head_commit
This commit is contained in:
josephschorr 2016-11-17 12:01:59 -05:00 committed by GitHub
commit c4b73318c0
3 changed files with 136 additions and 1 deletions

View file

@ -29,7 +29,7 @@ GITHUB_WEBHOOK_PAYLOAD_SCHEMA = {
'type': 'string',
},
'head_commit': {
'type': 'object',
'type': ['object', 'null'],
'properties': {
'id': {
'type': 'string',
@ -98,6 +98,9 @@ def get_transformed_webhook_payload(gh_payload, default_branch=None, lookup_user
payload = JSONPathDict(gh_payload)
if payload['head_commit'] is None:
raise SkipRequestException
config = SafeDictSetter()
config['commit'] = payload['head_commit.id']
config['ref'] = payload['ref']