normalizeWorkflowID extracts the workflow ID from a workflow identifier. It handles both workflow IDs ("my-workflow") and full paths (".github/workflows/my-workflow.md"). Returns the workflow ID without .md or .lock.yml extension. Note: unlike stringutil.NormalizeWorkflowName (which operates on bar
(workflowIDOrPath string)
| 480 | // Note: unlike stringutil.NormalizeWorkflowName (which operates on bare names), |
| 481 | // this function also handles file system paths by extracting the basename first. |
| 482 | func normalizeWorkflowID(workflowIDOrPath string) string { |
| 483 | // Get the base filename if it's a path |
| 484 | basename := filepath.Base(workflowIDOrPath) |
| 485 | |
| 486 | // Remove .md or .lock.yml extension if present |
| 487 | return stringutil.NormalizeWorkflowName(basename) |
| 488 | } |
| 489 | |
| 490 | // resolveWorkflowFile resolves a file or workflow name to an actual file path |
| 491 | // Note: This function only looks for local workflows, not packages |