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

Function extractSkipField

pkg/workflow/role_checks.go:536–547  ·  view source on GitHub ↗

extractSkipField extracts a named field from the 'on:' section of frontmatter. Returns nil if the field is not configured.

(frontmatter map[string]any, fieldName string)

Source from the content-addressed store, hash-verified

534// extractSkipField extracts a named field from the 'on:' section of frontmatter.
535// Returns nil if the field is not configured.
536func extractSkipField(frontmatter map[string]any, fieldName string) []string {
537 onValue, exists := frontmatter["on"]
538 if !exists || onValue == nil {
539 return nil
540 }
541 if on, ok := onValue.(map[string]any); ok {
542 if val, exists := on[fieldName]; exists && val != nil {
543 return parseOptionalStringSliceField(val, fieldName)
544 }
545 }
546 return nil
547}
548
549// extractSkipRoles extracts the 'skip-roles' field from the 'on:' section of frontmatter
550// Returns nil if skip-roles is not configured

Callers 2

extractSkipRolesMethod · 0.85
extractSkipBotsMethod · 0.85

Calls 1

Tested by

no test coverage detected