backend/git_service: accept webhook test requests

https://docs.github.com/en/webhooks-and-events/webhooks/testing-webhooks

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-02-20 13:10:58 +01:00
parent a79d25f7e7
commit d4a90e208b
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 4 additions and 0 deletions

View File

@ -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}"