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 => {