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

Function findWorkflowFileForExperiment

pkg/cli/experiments_command.go:457–469  ·  view source on GitHub ↗

findWorkflowFileForExperiment scans .github/workflows/ for a .md file whose sanitized basename (lowercase, hyphens removed) matches the given experiment name. Returns the file path or "" when no match is found.

(experimentName string)

Source from the content-addressed store, hash-verified

455// basename (lowercase, hyphens removed) matches the given experiment name.
456// Returns the file path or "" when no match is found.
457func findWorkflowFileForExperiment(experimentName string) string {
458 mdFiles, err := getMarkdownWorkflowFiles("")
459 if err != nil {
460 return ""
461 }
462 for _, f := range mdFiles {
463 base := strings.TrimSuffix(filepath.Base(f), ".md")
464 if workflow.SanitizeWorkflowIDForCacheKey(base) == experimentName {
465 return f
466 }
467 }
468 return ""
469}
470
471// workflowFileCandidates returns a fallback list of candidate workflow file basenames (without .md)
472// for remote lookups when the directory listing is unavailable. The sanitized form

Callers 2

Calls 2

getMarkdownWorkflowFilesFunction · 0.85

Tested by 1