renovate/lib/workers/repository/configured.ts
2020-05-01 18:03:48 +02:00

14 lines
381 B
TypeScript

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