From aacf6f784cc26ce5d644da07175b3bbc85ca60d2 Mon Sep 17 00:00:00 2001 From: Gabriel Ladzaretti Date: Tue, 31 Dec 2024 14:13:58 +0200 Subject: [PATCH] use util parseJson fn --- lib/workers/global/config/parse/env.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workers/global/config/parse/env.ts b/lib/workers/global/config/parse/env.ts index 6e46c9a735dbf2..a64919ea73194e 100644 --- a/lib/workers/global/config/parse/env.ts +++ b/lib/workers/global/config/parse/env.ts @@ -3,6 +3,7 @@ import JSON5 from 'json5'; import { getOptions } from '../../../../config/options'; import type { AllConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; +import { parseJson } from '../../../../util/common'; import { coersions } from './coersions'; import type { ParseConfigOptions } from './types'; import { migrateAndValidateConfig } from './util'; @@ -243,7 +244,7 @@ async function parseAndValidateOrExit( } try { - const config = JSON5.parse(env[configEnvKey]); + const config = parseJson(env[configEnvKey], '.json5') as AllConfig; logger.debug({ config }, `Detected config in env ${configEnvKey}`); return await migrateAndValidateConfig(config, `${configEnvKey}`);