From 5b4461bd4bafba96512bfd6f819ed022819791db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 26 Sep 2022 13:08:28 +0200 Subject: [PATCH] Run CLA check handler for all repositories (#49) --- services/bots/src/github-webhook/github-webhook.service.ts | 3 ++- services/bots/src/github-webhook/handlers/validate-cla.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/bots/src/github-webhook/github-webhook.service.ts b/services/bots/src/github-webhook/github-webhook.service.ts index 62914e8..605a256 100644 --- a/services/bots/src/github-webhook/github-webhook.service.ts +++ b/services/bots/src/github-webhook/github-webhook.service.ts @@ -25,7 +25,8 @@ export class GithubWebhookService { (handler) => (handler.allowBots || !context.senderIsBot) && handler.allowedEventTypes.includes(context.eventType) && - handler.allowedRepositories.includes(context.repositoryName), + (!handler.allowedRepositories.length || + handler.allowedRepositories.includes(context.repositoryName)), ).map((handler) => handler.handle(context)), ); } catch (err) { diff --git a/services/bots/src/github-webhook/handlers/validate-cla.ts b/services/bots/src/github-webhook/handlers/validate-cla.ts index f31ff39..b335e11 100644 --- a/services/bots/src/github-webhook/handlers/validate-cla.ts +++ b/services/bots/src/github-webhook/handlers/validate-cla.ts @@ -37,6 +37,7 @@ const botContextName = 'cla-bot'; @Injectable() export class ValidateCla extends BaseWebhookHandler { + public allowedRepositories = []; public allowedEventTypes = [ EventType.PULL_REQUEST_OPENED, EventType.PULL_REQUEST_REOPENED,