mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 03:17:38 -02:30
Update the webhook receiver git ref extractor logic
to deal with the null-ref case, and to deal correctly with Github push events.
This commit is contained in:
@@ -94,6 +94,8 @@ class WebhookReceiverBase(APIView):
|
|||||||
value = (value or {}).get(element)
|
value = (value or {}).get(element)
|
||||||
except Exception:
|
except Exception:
|
||||||
value = None
|
value = None
|
||||||
|
if value == '0000000000000000000000000000000000000000': # a deleted ref
|
||||||
|
value = None
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def get_signature(self):
|
def get_signature(self):
|
||||||
@@ -164,7 +166,7 @@ class GithubWebhookReceiver(WebhookReceiverBase):
|
|||||||
'pull_request': 'pull_request.head.sha',
|
'pull_request': 'pull_request.head.sha',
|
||||||
'pull_request_review': 'pull_request.head.sha',
|
'pull_request_review': 'pull_request.head.sha',
|
||||||
'pull_request_review_comment': 'pull_request.head.sha',
|
'pull_request_review_comment': 'pull_request.head.sha',
|
||||||
'push': 'head_commit',
|
'push': 'after',
|
||||||
'release': 'release.tag_name',
|
'release': 'release.tag_name',
|
||||||
'commit_comment': 'comment.commit_id',
|
'commit_comment': 'comment.commit_id',
|
||||||
'create': 'ref',
|
'create': 'ref',
|
||||||
|
|||||||
Reference in New Issue
Block a user