From 9fb0eeafdc8382f84d0d847ba21ff0b63b7a44ac Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sun, 6 Aug 2023 10:13:06 -0400 Subject: [PATCH] chore: fix weirdness Signed-off-by: IThundxr --- src/webserver/github.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webserver/github.ts b/src/webserver/github.ts index 91e31a8..3d976d4 100644 --- a/src/webserver/github.ts +++ b/src/webserver/github.ts @@ -206,9 +206,16 @@ const generateCommitsString = (head_sha: string) => { .map((commit) => { const committer = commit.committer; const userProfile = `https://github.com/${committer.username}`; - return `[➤](${commit.url}) ${commit.message} - [${committer.username}](${userProfile})`; + const messageWithoutHashtag = commit.message.replace(/#/g, ''); // Remove all '#' symbols + return `[➤](${commit.url}) ${messageWithoutHashtag} - [${committer.username}](${userProfile})`; }) .join('\n'); + + if (commitString.length > 3072) { + const url = `https://github.com/Layers-of-Railways/Railway/commits/${head_sha}`; + return `Commits are too long to display please check [here](${url})`; + } + return commitString; };