String returns the canonical string representation of the workflow spec in the format "owner/repo/path[@version]", just the WorkflowPath for local specs, or the raw URL for generic URL specs.
()
| 86 | // in the format "owner/repo/path[@version]", just the WorkflowPath for local |
| 87 | // specs, or the raw URL for generic URL specs. |
| 88 | func (w *WorkflowSpec) String() string { |
| 89 | // For generic URL specs, return the raw URL. |
| 90 | if w.RawURL != "" { |
| 91 | return w.RawURL |
| 92 | } |
| 93 | |
| 94 | // For local workflows, return just the WorkflowPath |
| 95 | if isLocalWorkflowPath(w.WorkflowPath) { |
| 96 | return w.WorkflowPath |
| 97 | } |
| 98 | |
| 99 | // For remote workflows, use the standard format |
| 100 | spec := w.RepoSlug + "/" + w.WorkflowPath |
| 101 | if w.Version != "" { |
| 102 | spec += "@" + w.Version |
| 103 | } |
| 104 | return spec |
| 105 | } |
| 106 | |
| 107 | // parseRepoSpec parses repository specification like "org/repo@version" or "org/repo@branch" or "org/repo@commit" |
| 108 | // Also supports GitHub URLs like "https://github.com/owner/repo[@version]" |