mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
webhooks/github: Be more explicit about unsupported PR events.
This was technically a bug. For events that aren't unsupported intentionally, the control should fall to the line that raises UnknownWebhookEventType, and shouldn't be handled by anything else. The events that are intentionally unsupported should be handled more explicitly.
This commit is contained in:
@@ -389,8 +389,9 @@ def get_event(request: HttpRequest, payload: Dict[str, Any], branches: str) -> O
|
||||
return 'assigned_or_unassigned_pull_request'
|
||||
if action == 'closed':
|
||||
return 'closed_pull_request'
|
||||
logging.warning(u'Event pull_request with {} action is unsupported'.format(action))
|
||||
return None
|
||||
# Unsupported pull_request events
|
||||
if action in ('labeled', 'unlabeled', 'review_request_removed'):
|
||||
return None
|
||||
if event == 'push':
|
||||
if is_commit_push_event(payload):
|
||||
if branches is not None:
|
||||
|
||||
Reference in New Issue
Block a user