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];
|
const val = config[key];
|
||||||
if (allowedStrings.includes(key) && typeof val === 'string') {
|
if (allowedStrings.includes(key) && typeof val === 'string') {
|
||||||
massagedConfig[key] = [val];
|
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`;
|
massagedConfig.npmrc = `//registry.npmjs.org/:_authToken=${val}\n`;
|
||||||
delete massagedConfig.npmToken;
|
delete massagedConfig.npmToken;
|
||||||
} else if (isObject(val)) {
|
} else if (isObject(val)) {
|
||||||
|
|
|
@ -99,6 +99,9 @@ function migrateConfig(config, parentConfig) {
|
||||||
isMigrated = true;
|
isMigrated = true;
|
||||||
migratedConfig.packagePatterns = [val];
|
migratedConfig.packagePatterns = [val];
|
||||||
delete migratedConfig.packagePattern;
|
delete migratedConfig.packagePattern;
|
||||||
|
} else if (key === 'schedule' && !val) {
|
||||||
|
isMigrated = true;
|
||||||
|
migratedConfig.schedule = [];
|
||||||
} else if (key === 'schedule') {
|
} else if (key === 'schedule') {
|
||||||
// massage to array first
|
// massage to array first
|
||||||
const schedules = typeof val === 'string' ? [val] : val;
|
const schedules = typeof val === 'string' ? [val] : val;
|
||||||
|
|
|
@ -18,12 +18,13 @@ Object {
|
||||||
"minor": Object {
|
"minor": Object {
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
},
|
},
|
||||||
|
"schedule": Array [],
|
||||||
},
|
},
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"ignorePaths": Array [
|
"ignorePaths": Array [
|
||||||
"node_modules/",
|
"node_modules/",
|
||||||
],
|
],
|
||||||
"lockFileConfig": Object {
|
"lockFileMaintenance": Object {
|
||||||
"automerge": true,
|
"automerge": true,
|
||||||
"schedule": "before 5am",
|
"schedule": "before 5am",
|
||||||
},
|
},
|
||||||
|
|
|
@ -36,12 +36,13 @@ describe('config/migration', () => {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
lockFileConfig: {
|
lockFileMaintenance: {
|
||||||
automerge: 'any',
|
automerge: 'any',
|
||||||
schedule: 'before 5am every day',
|
schedule: 'before 5am every day',
|
||||||
},
|
},
|
||||||
devDependencies: {
|
devDependencies: {
|
||||||
automerge: 'minor',
|
automerge: 'minor',
|
||||||
|
schedule: null,
|
||||||
},
|
},
|
||||||
depTypes: [
|
depTypes: [
|
||||||
'dependencies',
|
'dependencies',
|
||||||
|
|
Loading…
Reference in a new issue