isLocalWorkflowPath checks if a path refers to a local filesystem workflow. Local paths include: - Relative paths starting with "./", "../", ".\", or "..\", or equal to "." / ".." - Absolute paths as determined by filepath.IsAbs (OS-specific) - UNC-style paths starting with "\\" or "//" (Windows net
(path string)
| 61 | // - Absolute paths as determined by filepath.IsAbs (OS-specific) |
| 62 | // - UNC-style paths starting with "\\" or "//" (Windows network paths) |
| 63 | func isLocalWorkflowPath(path string) bool { |
| 64 | // Explicit relative path checks (POSIX and Windows-style) |
| 65 | if path == "." || path == ".." { |
| 66 | return true |
| 67 | } |
| 68 | if strings.HasPrefix(path, "./") || strings.HasPrefix(path, "../") || |
| 69 | strings.HasPrefix(path, ".\\") || strings.HasPrefix(path, "..\\") { |
| 70 | return true |
| 71 | } |
| 72 | |
| 73 | // OS-specific absolute paths (e.g., "/foo", "C:\foo", "D:/foo", UNC on Windows) |
| 74 | if filepath.IsAbs(path) { |
| 75 | return true |
| 76 | } |
| 77 | |
| 78 | // UNC paths (e.g., "\\server\share\file.md" or "//server/share/file.md") |
| 79 | if strings.HasPrefix(path, `\\`) || strings.HasPrefix(path, "//") { |
| 80 | return true |
| 81 | } |
| 82 | return false |
| 83 | } |
| 84 | |
| 85 | // String returns the canonical string representation of the workflow spec |
| 86 | // in the format "owner/repo/path[@version]", just the WorkflowPath for local |
no outgoing calls