Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
github webhook: Ignore more pull_request actions.
Steve Howell294fd599837d
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.pyindex 24bea1a66c7..287891983ce 100644--- a/zerver/webhooks/github/tests.py+++ b/zerver/webhooks/github/tests.py@@ -358,6 +358,8 @@ A temporary team so that I can get some webhook fixtures!def test_ignored_pull_request_actions(self) -> None:ignored_actions = [+ "approved",+ "converted_to_draft","labeled","review_request_removed","unlabeled",diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.pyindex 08c99c9d0f6..73f7d4b8165 100644--- a/zerver/webhooks/github/view.py+++ b/zerver/webhooks/github/view.py@@ -526,6 +526,14 @@ IGNORED_EVENTS = ["repository_vulnerability_alert",]+IGNORED_PULL_REQUEST_ACTIONS = [+ "approved",+ "converted_to_draft",+ "labeled",+ "review_request_removed",+ "unlabeled",+]+@api_key_only_webhook_view('GitHub', notify_bot_owner_on_invalid_json=True)@has_request_variablesdef api_github_webhook(@@ -561,8 +569,7 @@ def get_event(request: HttpRequest, payload: Dict[str, Any], branches: Optional[return f'{event}_{action}'if action == 'ready_for_review':return 'pull_request_ready_for_review'- # Unsupported pull_request events- if action in ('labeled', 'unlabeled', 'review_request_removed'):+ if action in IGNORED_PULL_REQUEST_ACTIONS:return Noneelif event == 'push':if is_commit_push_event(payload):