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

Function validateWorkflowRunHasWorkflows

pkg/workflow/agent_validation.go:298–314  ·  view source on GitHub ↗
(workflowRunMap map[string]any, markdownPath string)

Source from the content-addressed store, hash-verified

296}
297
298func 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
305GitHub Actions requires on.workflow_run.workflows to reference at least one workflow.
306Without it, the compiled workflow is invalid and will be rejected.
307
308Suggested fix:
309on:
310 workflow_run:
311 workflows: ["your-workflow"]
312 types: [completed]`
313 return formatCompilerError(markdownPath, "error", message, nil)
314}
315
316func (c *Compiler) emitWorkflowRunMissingBranches(markdownPath string) error {
317 message := "workflow_run trigger should include branch restrictions for security and performance.\n\n" +

Callers 1

Calls 2

formatCompilerErrorFunction · 0.85

Tested by

no test coverage detected