renovate/lib/config/migrations/custom/semantic-commits-migration.ts

15 lines
443 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class SemanticCommitsMigration extends AbstractMigration {
override readonly propertyName = 'semanticCommits';
override run(value: unknown): void {
if (is.boolean(value)) {
this.rewrite(value ? 'enabled' : 'disabled');
} else if (value !== 'enabled' && value !== 'disabled') {
this.rewrite('auto');
}
}
}