(workflowData *WorkflowData, markdownPath string)
| 356 | } |
| 357 | |
| 358 | func (c *Compiler) validateResourcesAndDispatches(workflowData *WorkflowData, markdownPath string) error { |
| 359 | workflowLog.Printf("Validating resources field") |
| 360 | if workflowData.ParsedFrontmatter != nil { |
| 361 | for _, r := range workflowData.ParsedFrontmatter.Resources { |
| 362 | if strings.Contains(r, "${{") { |
| 363 | return formatCompilerError(markdownPath, "error", |
| 364 | fmt.Sprintf("resources entry %q contains GitHub Actions expression syntax (${{) which is not allowed; use static paths only", r), nil) |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | dispatchValidators := []struct { |
| 369 | logMessage string |
| 370 | errPrefix string |
| 371 | validateFn func(*WorkflowData, string) error |
| 372 | }{ |
| 373 | {logMessage: "Validating dispatch-workflow configuration", errPrefix: "dispatch-workflow validation failed: ", validateFn: c.validateDispatchWorkflow}, |
| 374 | {logMessage: "Validating dispatch_repository configuration", errPrefix: "dispatch_repository validation failed: ", validateFn: c.validateDispatchRepository}, |
| 375 | {logMessage: "Validating call-workflow configuration", errPrefix: "call-workflow validation failed: ", validateFn: c.validateCallWorkflow}, |
| 376 | } |
| 377 | for _, validator := range dispatchValidators { |
| 378 | workflowLog.Print(validator.logMessage) |
| 379 | if err := validator.validateFn(workflowData, markdownPath); err != nil { |
| 380 | return formatCompilerError(markdownPath, "error", validator.errPrefix+err.Error(), err) |
| 381 | } |
| 382 | } |
| 383 | return nil |
| 384 | } |
| 385 | |
| 386 | // shouldWarnSparseInteractionCells reports whether the compiler should emit a |
| 387 | // sparse-cell interaction warning. |
no test coverage detected