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

Function workflowHasAwContextInput

pkg/workflow/safe_outputs_dispatch.go:73–92  ·  view source on GitHub ↗

workflowHasAwContextInput reports whether the workflow identified by fileResult has aw_context declared in its workflow_dispatch.inputs.

(fileResult *findWorkflowFileResult, workflowName string)

Source from the content-addressed store, hash-verified

71// workflowHasAwContextInput reports whether the workflow identified by fileResult
72// has aw_context declared in its workflow_dispatch.inputs.
73func workflowHasAwContextInput(fileResult *findWorkflowFileResult, workflowName string) bool {
74 var inputs map[string]any
75 var err error
76
77 if fileResult.lockExists {
78 inputs, err = extractWorkflowDispatchInputs(fileResult.lockPath)
79 } else if fileResult.ymlExists {
80 inputs, err = extractWorkflowDispatchInputs(fileResult.ymlPath)
81 } else if fileResult.mdExists {
82 inputs, err = extractMDWorkflowDispatchInputs(fileResult.mdPath)
83 } else {
84 return false
85 }
86 if err != nil {
87 safeOutputsConfigLog.Printf("Warning: error extracting inputs for %s: %v", workflowName, err)
88 return false
89 }
90 _, hasAwContext := inputs["aw_context"]
91 return hasAwContext
92}
93
94// generateDispatchWorkflowTool generates an MCP tool definition for a specific workflow.
95// The tool will be named after the workflow (normalized to underscores) and accept

Callers 1

Calls 3

PrintfMethod · 0.45

Tested by

no test coverage detected