MCPcopy Index your code
hub / github.com/github/gh-aw / validateIncludedFrontmatterWithFallback

Function validateIncludedFrontmatterWithFallback

pkg/parser/include_processor.go:219–231  ·  view source on GitHub ↗
(filePath string, frontmatter map[string]any, isWorkflowFile, isAgentFile bool)

Source from the content-addressed store, hash-verified

217}
218
219func validateIncludedFrontmatterWithFallback(filePath string, frontmatter map[string]any, isWorkflowFile, isAgentFile bool) error {
220 if isAgentFile || strings.HasPrefix(filePath, BuiltinPathPrefix) {
221 return nil
222 }
223 validationErr := ValidateIncludedFileFrontmatterWithSchemaAndLocation(frontmatter, filePath)
224 if validationErr == nil || isWorkflowFile {
225 return validationErr
226 }
227
228 includeLog.Printf("Validation failed for non-workflow file %s, applying relaxed validation", filePath)
229 applyRelaxedIncludedFrontmatterValidation(filePath, frontmatter, isAgentFile)
230 return validationErr
231}
232
233func applyRelaxedIncludedFrontmatterValidation(filePath string, frontmatter map[string]any, isAgentFile bool) {
234 if len(frontmatter) == 0 {

Callers 1

Tested by

no test coverage detected