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

Method validateFeatureConfig

pkg/workflow/compiler_validators.go:98–120  ·  view source on GitHub ↗

validateFeatureConfig validates feature flags declared in the workflow frontmatter and applies any action-mode override specified via the "action-mode" feature flag.

(workflowData *WorkflowData, markdownPath string)

Source from the content-addressed store, hash-verified

96// validateFeatureConfig validates feature flags declared in the workflow frontmatter
97// and applies any action-mode override specified via the "action-mode" feature flag.
98func (c *Compiler) validateFeatureConfig(workflowData *WorkflowData, markdownPath string) error {
99 // Validate feature flags
100 workflowLog.Printf("Validating feature flags")
101 if err := validateFeatures(workflowData); err != nil {
102 return formatCompilerError(markdownPath, "error", err.Error(), err)
103 }
104
105 // Check for action-mode feature flag override
106 if workflowData.Features != nil {
107 if actionModeVal, exists := workflowData.Features["action-mode"]; exists {
108 if actionModeStr, ok := actionModeVal.(string); ok && actionModeStr != "" {
109 mode := ActionMode(actionModeStr)
110 if !mode.IsValid() {
111 return formatCompilerError(markdownPath, "error", fmt.Sprintf("invalid action-mode feature flag '%s'. Must be 'dev', 'release', or 'script'", actionModeStr), nil)
112 }
113 workflowLog.Printf("Overriding action mode from feature flag: %s", mode)
114 c.SetActionMode(mode)
115 }
116 }
117 }
118
119 return nil
120}
121
122// validateToolConfiguration validates safe-outputs settings, on.needs and safe-job
123// declarations, network configuration, labels, concurrency expressions, sandbox

Callers 2

validateWorkflowDataMethod · 0.95

Calls 7

SetActionModeMethod · 0.95
validateFeaturesFunction · 0.85
formatCompilerErrorFunction · 0.85
ActionModeTypeAlias · 0.85
PrintfMethod · 0.45
ErrorMethod · 0.45
IsValidMethod · 0.45

Tested by 1