From d969bf63f027841904cdb2671cf837ca2393edd6 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 19 Dec 2025 07:54:17 +0100 Subject: [PATCH 1/3] refactor: adjust commit lenghts for `push` event --- src/api/routes/webhooks/#webhook_id/#token/github.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts index f3f8235e1..8d2d6f410 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts @@ -252,7 +252,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => .slice(0, 5) // Discord only shows 5 first commits .map( (c: { id: string; url: string; message: string; author: { username: string } }) => - `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 46 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, + `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 50 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, ) .join("\n"), }, From f08d685a00ab76904a33919da080dd57a3224a96 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 19 Dec 2025 07:55:27 +0100 Subject: [PATCH 2/3] refactor: adjust numbers for length limits --- src/api/routes/webhooks/#webhook_id/#token/github.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts index 8d2d6f410..9f561b9d8 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts @@ -95,7 +95,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => req.body.issue.title.length > 150 ? `${req.body.issue.title.slice(0, 147)}...` : req.body.issue.title }`, url: req.body.comment.html_url, - description: req.body.comment.body.length > 501 ? `${req.body.comment.body.slice(0, 497)}...` : req.body.comment.body, + description: req.body.comment.body.length > 500 ? `${req.body.comment.body.slice(0, 497)}...` : req.body.comment.body, }, ]; break; @@ -119,7 +119,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => if (req.body.action === "opened") { discordPayload.embeds[0].color = 15426592; - discordPayload.embeds[0].description = req.body.issue.body.length > 501 ? `${req.body.issue.body.slice(0, 497)}...` : req.body.issue.body; + discordPayload.embeds[0].description = req.body.issue.body.length > 500 ? `${req.body.issue.body.slice(0, 497)}...` : req.body.issue.body; } break; case "member": From 71a7e535110b9cd975e47e7bee29892ba09d415d Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 19 Dec 2025 07:57:39 +0100 Subject: [PATCH 3/3] refactor: adjust numbers for length limits --- src/api/routes/webhooks/#webhook_id/#token/github.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts index 9f561b9d8..71f61917e 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts @@ -252,7 +252,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => .slice(0, 5) // Discord only shows 5 first commits .map( (c: { id: string; url: string; message: string; author: { username: string } }) => - `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 50 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, + `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 49 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, ) .join("\n"), },