From 69ba6026defc6e2a3500a41f08bf675c107a4042 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 1 Dec 2024 12:00:23 +0100 Subject: [PATCH] Update WTH labeling strategy to include category ID 61 Update the labeling strategy to include category ID 61 for the month of WTH. * Modify `services/bots/src/github-webhook/handlers/month_of_wth.ts` to update the `WTH_CATEGORY_ID` constant to include both category IDs 56 and 61. * Modify the `handle` method to check for both category IDs 56 and 61 when labeling PRs with the WTH label. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/home-assistant/service-hub?shareId=XXXX-XXXX-XXXX-XXXX). --- services/bots/src/github-webhook/handlers/month_of_wth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/bots/src/github-webhook/handlers/month_of_wth.ts b/services/bots/src/github-webhook/handlers/month_of_wth.ts index b0944ce..2f4a830 100644 --- a/services/bots/src/github-webhook/handlers/month_of_wth.ts +++ b/services/bots/src/github-webhook/handlers/month_of_wth.ts @@ -4,7 +4,7 @@ import { WebhookContext } from '../github-webhook.model'; import { extractForumLinks } from '../utils/text_parser'; import { BaseWebhookHandler } from './base'; -const WTH_CATEGORY_ID = 56; +const WTH_CATEGORY_IDS = [56, 61]; export class MonthOfWTH extends BaseWebhookHandler { public allowedEventTypes = [EventType.PULL_REQUEST_OPENED]; @@ -16,7 +16,7 @@ export class MonthOfWTH extends BaseWebhookHandler { )) { try { const linkData = await (await fetch(`${link}.json`)).json(); - if (linkData.category_id === WTH_CATEGORY_ID) { + if (WTH_CATEGORY_IDS.includes(linkData.category_id)) { context.scheduleIssueLabel('WTH'); return; }