(onYAML string)
| 274 | } |
| 275 | |
| 276 | func parseWorkflowRunTrigger(onYAML string) (map[string]any, bool) { |
| 277 | var parsedData map[string]any |
| 278 | if err := yaml.Unmarshal([]byte(onYAML), &parsedData); err != nil { |
| 279 | agentValidationLog.Printf("Could not parse On field as YAML: %v", err) |
| 280 | return nil, false |
| 281 | } |
| 282 | onData, hasOn := parsedData["on"] |
| 283 | if !hasOn { |
| 284 | return nil, false |
| 285 | } |
| 286 | onMap, isMap := onData.(map[string]any) |
| 287 | if !isMap { |
| 288 | return nil, false |
| 289 | } |
| 290 | workflowRunVal, hasWorkflowRun := onMap["workflow_run"] |
| 291 | if !hasWorkflowRun { |
| 292 | return nil, false |
| 293 | } |
| 294 | workflowRunMap, ok := workflowRunVal.(map[string]any) |
| 295 | return workflowRunMap, ok |
| 296 | } |
| 297 | |
| 298 | func validateWorkflowRunHasWorkflows(workflowRunMap map[string]any, markdownPath string) error { |
| 299 | workflowsVal, hasWorkflows := workflowRunMap["workflows"] |
no test coverage detected