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

Function extractEngineIDFromFile

pkg/cli/workflows.go:461–474  ·  view source on GitHub ↗

extractEngineIDFromFile extracts the engine ID from a workflow file's frontmatter

(filePath string)

Source from the content-addressed store, hash-verified

459
460// extractEngineIDFromFile extracts the engine ID from a workflow file's frontmatter
461func 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").

Callers 2

RunListWorkflowsFunction · 0.85
GetWorkflowStatusesFunction · 0.85

Tested by

no test coverage detected