fix: Buildlog line number is not string

This commit is contained in:
Andras Bacsai 2022-04-17 23:32:27 +02:00
parent ffac7c5c87
commit 0c3a381d1f

View File

@ -61,14 +61,12 @@ export const saveBuildLog = async ({
buildId: string; buildId: string;
applicationId: string; applicationId: string;
}): Promise<Job> => { }): Promise<Job> => {
if (line) { if (line && typeof line === 'string' && line.includes('ghs_')) {
if (line.includes('ghs_')) { const regex = /ghs_.*@/g;
const regex = /ghs_.*@/g; line = line.replace(regex, '<SENSITIVE_DATA_DELETED>@');
line = line.replace(regex, '<SENSITIVE_DATA_DELETED>@');
}
const addTimestamp = `${generateTimestamp()} ${line}`;
return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId });
} }
const addTimestamp = `${generateTimestamp()} ${line}`;
return await buildLogQueue.add(buildId, { buildId, line: addTimestamp, applicationId });
}; };
export const getTeam = (event: RequestEvent): string | null => { export const getTeam = (event: RequestEvent): string | null => {