From f2d93c5d41f932a3520dfda4b3d6ac2552b69923 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Fri, 27 Mar 2026 12:10:46 +0200 Subject: [PATCH] fix: only run pack command on djs repo --- pnpm-workspace.yaml | 5 +++++ src/app.ts | 10 +++++++++- src/index.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 pnpm-workspace.yaml diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..7106f0b --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,5 @@ +onlyBuiltDependencies: + - esbuild + - sharp + - unrs-resolver + - workerd diff --git a/src/app.ts b/src/app.ts index 310d559..869fcd8 100644 --- a/src/app.ts +++ b/src/app.ts @@ -69,6 +69,14 @@ async function isPRGreen(octokit: Octokit, owner: string, repo: string, pullNumb async function commentHandler(data: IssueCommentCreatedData | IssueCommentEditedData, env: Env) { logger.debug('in comment handler'); + if (data.payload.repository.owner.login !== 'discordjs' || data.payload.repository.name !== 'discord.js') { + logger.debug( + { repository: data.payload.repository.name, owner: data.payload.repository.owner.login }, + 'Comment is not on the discord.js repository', + ); + return; + } + if (!data.payload.comment.body.startsWith('@discord-js-bot pack this')) { logger.debug({ body: data.payload.comment.body }, 'Comment does not start with "@discord-js-bot pack this"'); return; @@ -118,7 +126,7 @@ async function commentHandler(data: IssueCommentCreatedData | IssueCommentEdited comment_id: data.payload.comment.id, content: 'eyes', }) - // eslint-disable-next-line promise/prefer-await-to-then + // eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-await-to-callbacks .catch((error) => logger.warn({ err: error }, 'Failed to update reactions on start')); const ref = `refs/pull/${data.payload.issue.number}/head`; diff --git a/src/index.ts b/src/index.ts index c8ecf38..ca5095d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,6 +51,6 @@ const server = { }); } }, -}; +} satisfies ExportedHandler; export default server;