From d20c7f86277d16b4f173eebc9ee9a1dc8fbaa1d1 Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Fri, 29 May 2026 16:04:16 +0200 Subject: [PATCH 1/3] fix: handle 404 gracefully when a governance team does not exist --- dist/index.js | 13 +++++++++++-- src/bot.ts | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7181be2..5311eae 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8939,8 +8939,17 @@ function getCommandsFromComment(body) { exports.getCommandsFromComment = getCommandsFromComment; function inTeam(org, username, team) { return __awaiter(this, void 0, void 0, function* () { - const members = yield octokit_1.default.teams.listMembersInOrg({ org, team_slug: team }); - return members.data.map(m => m.login).includes(username); + try { + const members = yield octokit_1.default.teams.listMembersInOrg({ org, team_slug: team }); + return members.data.map(m => m.login).includes(username); + } + catch (e) { + if (e.status === 404) { + console.warn(`404 while fetching members of '${team}' team`); + return false; + } + throw e; + } }); } exports.inTeam = inTeam; diff --git a/src/bot.ts b/src/bot.ts index 9df106d..001d24c 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -39,9 +39,18 @@ export function getCommandsFromComment(body: string): Command[] { } export async function inTeam(org: string, username: string, team: string) { - const members = await octokit.teams.listMembersInOrg({ org, team_slug: team }); + try { + const members = await octokit.teams.listMembersInOrg({ org, team_slug: team }); + + return members.data.map(m => m.login).includes(username); + } catch (e) { + if ((e as RequestError).status === 404) { + console.warn(`404 while fetching members of '${team}' team`); + return false; + } - return members.data.map(m => m.login).includes(username); + throw e; + } } export async function isMaintainer(org: string, username: string) { From a0040c5da6042ba3419d40261e299dd6aeb53023 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 11 Jun 2026 20:16:38 +0200 Subject: [PATCH 2/3] Apply suggestion from @bfabio --- src/bot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot.ts b/src/bot.ts index 001d24c..bf3aeb8 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -45,7 +45,7 @@ export async function inTeam(org: string, username: string, team: string) { return members.data.map(m => m.login).includes(username); } catch (e) { if ((e as RequestError).status === 404) { - console.warn(`404 while fetching members of '${team}' team`); + console.error(`404 while fetching members of '${team}' team`); return false; } From 0a447c881f64ed3c6e01c044f1fdc0b70292063d Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 11 Jun 2026 20:20:39 +0200 Subject: [PATCH 3/3] chore: rebuild dist The applied suggestion changed only the source. The action runs the committed bundle, which still logged at warn level. --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 5311eae..e002a2c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8945,7 +8945,7 @@ function inTeam(org, username, team) { } catch (e) { if (e.status === 404) { - console.warn(`404 while fetching members of '${team}' team`); + console.error(`404 while fetching members of '${team}' team`); return false; } throw e;