0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-05-12 23:51:55 +00:00
renovatebot_renovate/lib/config/migrations/custom/rebase-stale-prs-migration.ts
2025-03-06 11:46:35 +00:00

24 lines
652 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class RebaseStalePrsMigration extends AbstractMigration {
override readonly deprecated = true;
override readonly propertyName = 'rebaseStalePrs';
override run(value: unknown): void {
const rebaseConflictedPrs = this.get('rebaseConflictedPrs');
if (rebaseConflictedPrs !== false) {
if (is.boolean(value)) {
this.setSafely(
'rebaseWhen',
value ? 'behind-base-branch' : 'conflicted',
);
}
if (null === value) {
this.setSafely('rebaseWhen', 'auto');
}
}
}
}