MCPcopy Create free account
hub / github.com/github/gh-aw / validateRepoConfigValues

Function validateRepoConfigValues

pkg/workflow/repo_config.go:274–295  ·  view source on GitHub ↗
(cfg *RepoConfig)

Source from the content-addressed store, hash-verified

272}
273
274func validateRepoConfigValues(cfg *RepoConfig) error {
275 if cfg == nil {
276 return nil
277 }
278 if cfg.UTC != "" {
279 normalized, err := NormalizeUTCOffset(cfg.UTC)
280 if err != nil {
281 return fmt.Errorf("invalid %s: utc %w", RepoConfigFileName, err)
282 }
283 cfg.UTC = normalized
284 }
285
286 if cfg.Maintenance == nil || cfg.Maintenance.Compile == nil {
287 return nil
288 }
289 compileCfg := cfg.Maintenance.Compile
290 secretName := compileCfg.CreatePullRequestGitHubToken
291 if secretName != "" && !repoConfigSecretNamePattern.MatchString(secretName) {
292 return fmt.Errorf("invalid %s: maintenance.compile.create_pull_request_github_token must match %s", RepoConfigFileName, repoConfigSecretNamePattern.String())
293 }
294 return nil
295}
296
297// FormatRunsOn serialises a RunsOnValue to a YAML-compatible string that can
298// be inlined directly after "runs-on: " in a generated workflow.

Callers 1

LoadRepoConfigFunction · 0.85

Calls 3

NormalizeUTCOffsetFunction · 0.85
ErrorfMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected