From 0c3a381d1fbee1c8c2430ada5c482770f2a64062 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 17 Apr 2022 23:32:27 +0200 Subject: [PATCH] fix: Buildlog line number is not string --- src/lib/common.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/common.ts b/src/lib/common.ts index 1b5754917..8bcc48b99 100644 --- a/src/lib/common.ts +++ b/src/lib/common.ts @@ -61,14 +61,12 @@ export const saveBuildLog = async ({ buildId: string; applicationId: string; }): Promise => { - if (line) { - if (line.includes('ghs_')) { - const regex = /ghs_.*@/g; - line = line.replace(regex, '@'); - } - const addTimestamp = `${generateTimestamp()} ${line}`; - return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId }); + if (line && typeof line === 'string' && line.includes('ghs_')) { + const regex = /ghs_.*@/g; + line = line.replace(regex, '@'); } + const addTimestamp = `${generateTimestamp()} ${line}`; + return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId }); }; export const getTeam = (event: RequestEvent): string | null => {