Skip to content

Commit

Permalink
Update WTH labeling strategy to include category ID 61
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
frenck committed Dec 1, 2024
1 parent 814cd40 commit 69ba602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/bots/src/github-webhook/handlers/month_of_wth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
}
Expand Down

0 comments on commit 69ba602

Please sign in to comment.