parseLocalWorkflowSpec parses a local workflow specification starting with "./"
(spec string)
| 424 | |
| 425 | // parseLocalWorkflowSpec parses a local workflow specification starting with "./" |
| 426 | func parseLocalWorkflowSpec(spec string) (*WorkflowSpec, error) { |
| 427 | specLog.Printf("Parsing local workflow spec: %s", spec) |
| 428 | // Validate that it's a .md file |
| 429 | if !strings.HasSuffix(spec, ".md") { |
| 430 | specLog.Printf("Invalid extension for local workflow: %s", spec) |
| 431 | return nil, fmt.Errorf("local workflow specification must end with '.md' extension: %s", spec) |
| 432 | } |
| 433 | |
| 434 | specLog.Printf("Parsed local workflow: path=%s", spec) |
| 435 | |
| 436 | return &WorkflowSpec{ |
| 437 | RepoSpec: RepoSpec{ |
| 438 | RepoSlug: "", // Local workflows have no remote repo |
| 439 | Version: "", // Local workflows have no version |
| 440 | }, |
| 441 | WorkflowPath: spec, // Keep the "./" prefix in WorkflowPath |
| 442 | WorkflowName: strings.TrimSuffix(filepath.Base(spec), ".md"), |
| 443 | }, nil |
| 444 | } |
| 445 | |
| 446 | // parseSourceSpec parses a source specification like "owner/repo/path@ref" |
| 447 | // This is used for parsing the source field from workflow frontmatter |
no test coverage detected