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)
| 455 | // basename (lowercase, hyphens removed) matches the given experiment name. |
| 456 | // Returns the file path or "" when no match is found. |
| 457 | func 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 |