mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
fix: migrate null schedule to [] (#1021)
This commit is contained in:
parent
aa5a488157
commit
826753e329
4 changed files with 8 additions and 3 deletions
|
@ -18,7 +18,7 @@ function massageConfig(config) {
|
|||
const val = config[key];
|
||||
if (allowedStrings.includes(key) && typeof val === 'string') {
|
||||
massagedConfig[key] = [val];
|
||||
} else if (key === 'npmToken' && val.length < 30) {
|
||||
} else if (key === 'npmToken' && val && val.length < 30) {
|
||||
massagedConfig.npmrc = `//registry.npmjs.org/:_authToken=${val}\n`;
|
||||
delete massagedConfig.npmToken;
|
||||
} else if (isObject(val)) {
|
||||
|
|
|
@ -99,6 +99,9 @@ function migrateConfig(config, parentConfig) {
|
|||
isMigrated = true;
|
||||
migratedConfig.packagePatterns = [val];
|
||||
delete migratedConfig.packagePattern;
|
||||
} else if (key === 'schedule' && !val) {
|
||||
isMigrated = true;
|
||||
migratedConfig.schedule = [];
|
||||
} else if (key === 'schedule') {
|
||||
// massage to array first
|
||||
const schedules = typeof val === 'string' ? [val] : val;
|
||||
|
|
|
@ -18,12 +18,13 @@ Object {
|
|||
"minor": Object {
|
||||
"automerge": true,
|
||||
},
|
||||
"schedule": Array [],
|
||||
},
|
||||
"enabled": true,
|
||||
"ignorePaths": Array [
|
||||
"node_modules/",
|
||||
],
|
||||
"lockFileConfig": Object {
|
||||
"lockFileMaintenance": Object {
|
||||
"automerge": true,
|
||||
"schedule": "before 5am",
|
||||
},
|
||||
|
|
|
@ -36,12 +36,13 @@ describe('config/migration', () => {
|
|||
enabled: false,
|
||||
},
|
||||
],
|
||||
lockFileConfig: {
|
||||
lockFileMaintenance: {
|
||||
automerge: 'any',
|
||||
schedule: 'before 5am every day',
|
||||
},
|
||||
devDependencies: {
|
||||
automerge: 'minor',
|
||||
schedule: null,
|
||||
},
|
||||
depTypes: [
|
||||
'dependencies',
|
||||
|
|
Loading…
Reference in a new issue