MCPcopy Create free account
hub / github.com/angular/dev-infra / assertValidGithubConfig

Function assertValidGithubConfig

ng-dev/utils/config.ts:187–208  ·  view source on GitHub ↗
(
  config: T & Partial<{github: GithubConfig}>,
)

Source from the content-addressed store, hash-verified

185
186/** Validate th configuration has been met for the ng-dev command. */
187export function assertValidGithubConfig<T extends NgDevConfig>(
188 config: T & Partial<{github: GithubConfig}>,
189): asserts config is T & {github: GithubConfig} {
190 const errors: string[] = [];
191 // Validate the github configuration.
192 if (config.github === undefined) {
193 errors.push(`Github repository not configured. Set the "github" option.`);
194 } else {
195 if (config.github.name === undefined) {
196 errors.push(`"github.name" is not defined`);
197 }
198 if (config.github.owner === undefined) {
199 errors.push(`"github.owner" is not defined`);
200 }
201 if (config.github.mergeMode === undefined) {
202 errors.push(`"github.mergeMode" is not defined`);
203 }
204 }
205 if (errors.length) {
206 throw new ConfigValidationError('Invalid `github` configuration', errors);
207 }
208}
209
210/** Retrieve and validate the config as `CaretakerConfig`. */
211export function assertValidCaretakerConfig<T extends NgDevConfig>(

Callers 8

checkValidityFunction · 0.90
handlerFunction · 0.85
handlerFunction · 0.85
checkServiceStatusesFunction · 0.85
printTargetBranchesForPrFunction · 0.85
runFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected