diff --git a/lib/workers/repository/reconfigure/validate.spec.ts b/lib/workers/repository/reconfigure/validate.spec.ts index 730bf75e378edd77feab4de68564191733e6196e..44525545d065bda68754d5f7c886d6f0d2caeb8b 100644 --- a/lib/workers/repository/reconfigure/validate.spec.ts +++ b/lib/workers/repository/reconfigure/validate.spec.ts @@ -225,4 +225,25 @@ describe('workers/repository/reconfigure/validate', () => { state: 'green', }); }); + + it('handles array fields which accept strings', async () => { + fs.readLocalFile.mockResolvedValueOnce(` + { + "packageRules": [ + { + "description": "test", + "matchPackageNames": ["pkg"], + "enabled": false + } + ] + } + `); + await validateReconfigureBranch(config); + expect(platform.setBranchStatus).toHaveBeenCalledWith({ + branchName: 'prefix/reconfigure', + context: 'renovate/config-validation', + description: 'Validation Successful', + state: 'green', + }); + }); }); diff --git a/lib/workers/repository/reconfigure/validate.ts b/lib/workers/repository/reconfigure/validate.ts index ca1b6a68d668c491d780edf81403978693ef0ee7..1ad1927411b7befadb9b45c6f30ebfe5a8656062 100644 --- a/lib/workers/repository/reconfigure/validate.ts +++ b/lib/workers/repository/reconfigure/validate.ts @@ -1,5 +1,6 @@ import is from '@sindresorhus/is'; import JSON5 from 'json5'; +import { massageConfig } from '../../../config/massage'; import type { RenovateConfig } from '../../../config/types'; import { validateConfig } from '../../../config/validation'; import { logger } from '../../../logger'; @@ -138,7 +139,8 @@ export async function validateReconfigureBranch( } // perform validation and provide a passing or failing check based on result - const validationResult = await validateConfig('repo', configFileParsed); + const massagedConfig = massageConfig(configFileParsed); + const validationResult = await validateConfig('repo', massagedConfig); // failing check if (validationResult.errors.length > 0) {