0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/config/migrations/custom/branch-prefix-migration.ts

15 lines
500 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class BranchPrefixMigration extends AbstractMigration {
override readonly propertyName = 'branchPrefix';
override run(value: unknown): void {
if (is.string(value) && value.includes('{{')) {
const templateIndex = value.indexOf(`{{`);
this.rewrite(value.substring(0, templateIndex));
this.setHard('additionalBranchPrefix', value.substring(templateIndex));
}
}
}