(cfg *RepoConfig)
| 272 | } |
| 273 | |
| 274 | func 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. |
no test coverage detected