diff --git a/services/bots/src/github-webhook/github-webhook.const.ts b/services/bots/src/github-webhook/github-webhook.const.ts index 2a5294e..1b8aadc 100644 --- a/services/bots/src/github-webhook/github-webhook.const.ts +++ b/services/bots/src/github-webhook/github-webhook.const.ts @@ -19,6 +19,7 @@ export enum Repository { BRANDS = 'brands', CORE = 'core', DEVELOPERS_HOME_ASSISTANT = 'developers.home-assistant', + FRONTEND = 'frontend', HOME_ASSISTANT_IO = 'home-assistant.io', } diff --git a/services/bots/src/github-webhook/handlers/docs_parenting.ts b/services/bots/src/github-webhook/handlers/docs_parenting.ts index f023497..c63766f 100644 --- a/services/bots/src/github-webhook/handlers/docs_parenting.ts +++ b/services/bots/src/github-webhook/handlers/docs_parenting.ts @@ -27,7 +27,10 @@ export class DocsParenting extends BaseWebhookHandler { 'pull_request.closed', 'pull_request.opened', 'pull_request.edited', - ].includes(context.eventType) + ].includes(context.eventType) || + ![Repository.CORE, Repository.HOME_ASSISTANT_IO, Repository.FRONTEND].includes( + context.repo().repo as Repository, + ) ) { return; } diff --git a/services/bots/src/github-webhook/handlers/hacktoberfest.ts b/services/bots/src/github-webhook/handlers/hacktoberfest.ts index ed5381e..8ece90b 100644 --- a/services/bots/src/github-webhook/handlers/hacktoberfest.ts +++ b/services/bots/src/github-webhook/handlers/hacktoberfest.ts @@ -1,4 +1,5 @@ import { PullRequestClosedEvent } from '@octokit/webhooks-types'; +import { Repository } from '../github-webhook.const'; import { WebhookContext } from '../github-webhook.model'; import { BaseWebhookHandler } from './base'; @@ -6,6 +7,13 @@ export const isHacktoberfestLive = () => new Date().getMonth() === 9; export class Hacktoberfest extends BaseWebhookHandler { async handle(context: WebhookContext) { + if ( + ![Repository.CORE, Repository.HOME_ASSISTANT_IO, Repository.FRONTEND].includes( + context.repo().repo as Repository, + ) + ) { + return; + } if (isHacktoberfestLive && context.eventType === 'pull_request.opened') { await this.handlePullRequestOpened(context); } else if (context.eventType === 'pull_request.closed') {