extractSafeJobsFromFrontmatter extracts safe-jobs configuration from frontmatter. Only checks the safe-outputs.jobs location. The top-level "safe-jobs" syntax is NOT supported.
(frontmatter map[string]any)
| 365 | // extractSafeJobsFromFrontmatter extracts safe-jobs configuration from frontmatter. |
| 366 | // Only checks the safe-outputs.jobs location. The top-level "safe-jobs" syntax is NOT supported. |
| 367 | func extractSafeJobsFromFrontmatter(frontmatter map[string]any) map[string]*SafeJobConfig { |
| 368 | // Check location: safe-outputs.jobs |
| 369 | if safeOutputs, exists := frontmatter["safe-outputs"]; exists { |
| 370 | if safeOutputsMap, ok := safeOutputs.(map[string]any); ok { |
| 371 | if jobs, exists := safeOutputsMap["jobs"]; exists { |
| 372 | if jobsMap, ok := jobs.(map[string]any); ok { |
| 373 | c := NewCompiler() // Create a temporary compiler instance for parsing |
| 374 | return c.parseSafeJobsConfig(jobsMap) |
| 375 | } |
| 376 | } |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | return make(map[string]*SafeJobConfig) |
| 381 | } |
| 382 | |
| 383 | // mergeSafeJobs merges safe-jobs from multiple sources and detects name conflicts |
| 384 | func mergeSafeJobs(base map[string]*SafeJobConfig, additional map[string]*SafeJobConfig) (map[string]*SafeJobConfig, error) { |