From d2d1ee50a3923849666e2cb3638aa563a69c7867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 20 Feb 2023 13:10:58 +0100 Subject: [PATCH] backend/git_service: accept webhook test requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://docs.github.com/en/webhooks-and-events/webhooks/testing-webhooks Signed-off-by: Jakub SokoĊ‚owski --- src/spiffworkflow_backend/services/git_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spiffworkflow_backend/services/git_service.py b/src/spiffworkflow_backend/services/git_service.py index 16c064d1..e73dd061 100644 --- a/src/spiffworkflow_backend/services/git_service.py +++ b/src/spiffworkflow_backend/services/git_service.py @@ -206,6 +206,10 @@ class GitService: % (config_clone_url, valid_clone_urls) ) + # Test webhook requests have a zen koan and hook info. + if "zen" in webhook or "hook_id" in webhook: + return False + if "ref" not in webhook: raise InvalidGitWebhookBodyError( f"Could not find the 'ref' arg in the webhook boy: {webhook}"