mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
70a49def74
Co-authored-by: Rhys Arkins <rhys@arkins.net> Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
22 lines
753 B
TypeScript
22 lines
753 B
TypeScript
import type { RenovateConfig } from '../../../config/types';
|
|
import { checkConfigMigrationBranch } from './branch';
|
|
import { MigratedDataFactory } from './branch/migrated-data';
|
|
import { ensureConfigMigrationPr } from './pr';
|
|
|
|
export async function configMigration(
|
|
config: RenovateConfig,
|
|
branchList: string[]
|
|
): Promise<void> {
|
|
if (config.configMigration) {
|
|
const migratedConfigData = await MigratedDataFactory.getAsync();
|
|
const migrationBranch = await checkConfigMigrationBranch(
|
|
config,
|
|
migratedConfigData
|
|
); // null if migration not needed
|
|
if (migrationBranch) {
|
|
branchList.push(migrationBranch);
|
|
await ensureConfigMigrationPr(config, migratedConfigData!);
|
|
}
|
|
MigratedDataFactory.reset();
|
|
}
|
|
}
|