(workflowRunMap map[string]any, markdownPath string)
| 296 | } |
| 297 | |
| 298 | func validateWorkflowRunHasWorkflows(workflowRunMap map[string]any, markdownPath string) error { |
| 299 | workflowsVal, hasWorkflows := workflowRunMap["workflows"] |
| 300 | if hasWorkflows && hasNonEmptyWorkflowRunWorkflows(workflowsVal) { |
| 301 | return nil |
| 302 | } |
| 303 | message := `workflow_run trigger must include a non-empty workflows field. |
| 304 | |
| 305 | GitHub Actions requires on.workflow_run.workflows to reference at least one workflow. |
| 306 | Without it, the compiled workflow is invalid and will be rejected. |
| 307 | |
| 308 | Suggested fix: |
| 309 | on: |
| 310 | workflow_run: |
| 311 | workflows: ["your-workflow"] |
| 312 | types: [completed]` |
| 313 | return formatCompilerError(markdownPath, "error", message, nil) |
| 314 | } |
| 315 | |
| 316 | func (c *Compiler) emitWorkflowRunMissingBranches(markdownPath string) error { |
| 317 | message := "workflow_run trigger should include branch restrictions for security and performance.\n\n" + |
no test coverage detected