renovate/lib/workers/repository/configured.ts
Rhys Arkins fa9031f5e9 feat(internal): expand disabled error messages
Splits REPOSITORY_DISABLED into multiple
2021-02-11 13:32:29 +01:00

14 lines
401 B
TypeScript

import { RenovateConfig } from '../../config';
import {
REPOSITORY_DISABLED_BY_CONFIG,
REPOSITORY_FORKED,
} from '../../constants/error-messages';
export function checkIfConfigured(config: RenovateConfig): void {
if (config.enabled === false) {
throw new Error(REPOSITORY_DISABLED_BY_CONFIG);
}
if (config.isFork && !config.includeForks) {
throw new Error(REPOSITORY_FORKED);
}
}