extractLabelNames extracts the 'labels' field from frontmatter. When set, the pre-activation job emits a job-level if: condition that skips the workflow (gray ⊘ rather than red ❌) when the triggering label does not match.
(frontmatter map[string]any)
| 98 | // When set, the pre-activation job emits a job-level if: condition that skips the workflow |
| 99 | // (gray ⊘ rather than red ❌) when the triggering label does not match. |
| 100 | func (c *Compiler) extractLabelNames(frontmatter map[string]any) []string { |
| 101 | if onValue, exists := frontmatter["on"]; exists { |
| 102 | if onMap, ok := onValue.(map[string]any); ok { |
| 103 | if labelNamesValue, hasLabelNames := onMap["labels"]; hasLabelNames { |
| 104 | names := parseOptionalStringSliceField(labelNamesValue, "on.labels") |
| 105 | if len(names) > 0 { |
| 106 | roleLog.Printf("Extracted %d labels: %v", len(names), names) |
| 107 | return names |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | return nil |
| 113 | } |
| 114 | |
| 115 | // extractRoles extracts the 'roles' field from frontmatter to determine permission requirements |
| 116 | func (c *Compiler) extractRoles(frontmatter map[string]any) []string { |