feat: auto-assign issues and prs to naomi
Node.js CI / Lint and Test (push) Successful in 42s

This commit is contained in:
2025-08-27 17:58:28 -07:00
parent c48242a141
commit 1b7f83f335
8 changed files with 874 additions and 9 deletions
+11 -2
View File
@@ -7,6 +7,7 @@
import fastify from "fastify";
import { processGithubEvent } from "../modules/processGitHubEvent.js";
import { logger } from "../utils/logger.js";
import type { Amari } from "../interfaces/amari.js";
import type { GithubPayload } from "../interfaces/github.js";
const html = `<!DOCTYPE html>
@@ -52,8 +53,9 @@ const html = `<!DOCTYPE html>
/**
* Starts up a web server for health monitoring.
* @param amari - Amari's instance.
*/
export const instantiateServer = (): void => {
export const instantiateServer = (amari: Amari): void => {
try {
const server = fastify({
logger: false,
@@ -67,7 +69,14 @@ export const instantiateServer = (): void => {
server.
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
post<{ Body: GithubPayload }>("/github", async(request, response) => {
await processGithubEvent(request, response);
try {
await processGithubEvent(amari, request, response);
} catch (error) {
if (!(error instanceof Error)) {
return;
}
await logger.error("/github route", error);
}
});
server.listen({ port: 7044 }, (error) => {