renovate/lib/util/package-rules/repositories.ts
Adam Setch c85932d8d3
feat(package-rules): add matchRepositories / excludeRepositories (#23085)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-07-21 04:21:36 +00:00

19 lines
619 B
TypeScript

import type { PackageRule, PackageRuleInputConfig } from '../../config/types';
import { Matcher } from './base';
import { anyMatchRegexOrMinimatch } from './match';
export class RepositoriesMatcher extends Matcher {
override matches(
{ repository }: PackageRuleInputConfig,
{ matchRepositories }: PackageRule
): boolean | null {
return anyMatchRegexOrMinimatch(matchRepositories, repository);
}
override excludes(
{ repository }: PackageRuleInputConfig,
{ excludeRepositories }: PackageRule
): boolean | null {
return anyMatchRegexOrMinimatch(excludeRepositories, repository);
}
}