diff --git a/lib/workers/global/config/parse/__fixtures__/.renovaterc b/lib/workers/global/config/parse/__fixtures__/.renovaterc new file mode 100644 index 0000000000000000000000000000000000000000..d5c5a803902a540437723b682651eea15f5bedc7 --- /dev/null +++ b/lib/workers/global/config/parse/__fixtures__/.renovaterc @@ -0,0 +1,5 @@ +{ + // Renovate parses all configuration files as JSON5. + // https://github.com/renovatebot/renovate/pull/22991#issuecomment-1609106254 + token: "abcdefg", +} diff --git a/lib/workers/global/config/parse/file.spec.ts b/lib/workers/global/config/parse/file.spec.ts index c1e2038c9cde59472ecd2a443ff53b9d145558a6..3b7d22e34057cd82998fd63062e6d9e70693883f 100644 --- a/lib/workers/global/config/parse/file.spec.ts +++ b/lib/workers/global/config/parse/file.spec.ts @@ -35,6 +35,7 @@ describe('workers/global/config/parse/file', () => { 'custom js config file exporting an async function', 'config-async-function.js', ], + ['.renovaterc', '.renovaterc'], ['JSON5 config file', 'config.json5'], ['YAML config file', 'config.yaml'], ])('parses %s', async (fileType, filePath) => { diff --git a/lib/workers/global/config/parse/file.ts b/lib/workers/global/config/parse/file.ts index 5a66827ace215bc83ab29e0f1cb4d3c62ee894ca..eeeaf5671e11a4bccc8a32491ff9701f99286c70 100644 --- a/lib/workers/global/config/parse/file.ts +++ b/lib/workers/global/config/parse/file.ts @@ -9,6 +9,9 @@ import { logger } from '../../../../logger'; import { readSystemFile } from '../../../../util/fs'; export async function getParsedContent(file: string): Promise<RenovateConfig> { + if (upath.basename(file) === '.renovaterc') { + return JSON5.parse(await readSystemFile(file, 'utf8')); + } switch (upath.extname(file)) { case '.yaml': case '.yml':