Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
onlyBuiltDependencies:
- esbuild
- sharp
- unrs-resolver
- workerd
10 changes: 9 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ const server = {
});
}
},
};
} satisfies ExportedHandler<Env>;

export default server;
Loading