renovate/lib/config/migrations/custom/branch-name-migration.ts

15 lines
444 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class BranchNameMigration extends AbstractMigration {
override readonly propertyName = 'branchName';
override run(value: unknown): void {
if (is.string(value) && value.includes('{{managerBranchPrefix}}')) {
this.rewrite(
value.replace('{{managerBranchPrefix}}', '{{additionalBranchPrefix}}'),
);
}
}
}