extractEngineIDFromFile extracts the engine ID from a workflow file's frontmatter
(filePath string)
| 459 | |
| 460 | // extractEngineIDFromFile extracts the engine ID from a workflow file's frontmatter |
| 461 | func extractEngineIDFromFile(filePath string) string { |
| 462 | content, err := os.ReadFile(filePath) |
| 463 | if err != nil { |
| 464 | return "" // Return empty string if file cannot be read |
| 465 | } |
| 466 | |
| 467 | // Parse frontmatter |
| 468 | result, err := parser.ExtractFrontmatterFromContent(string(content)) |
| 469 | if err != nil { |
| 470 | return "" // Return empty string if frontmatter cannot be parsed |
| 471 | } |
| 472 | |
| 473 | return extractEngineIDFromFrontmatter(result.Frontmatter) |
| 474 | } |
| 475 | |
| 476 | // normalizeWorkflowID extracts the workflow ID from a workflow identifier. |
| 477 | // It handles both workflow IDs ("my-workflow") and full paths (".github/workflows/my-workflow.md"). |
no test coverage detected