MCPcopy Create free account
hub / github.com/github/gh-aw / isLocalWorkflowPath

Function isLocalWorkflowPath

pkg/cli/spec.go:63–83  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

61// - Absolute paths as determined by filepath.IsAbs (OS-specific)
62// - UNC-style paths starting with "\\" or "//" (Windows network paths)
63func 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

Callers 12

StringMethod · 0.85
parseWorkflowSpecFunction · 0.85
compileAddedWorkflowFunction · 0.85
ResolveWorkflowsFunction · 0.85

Calls

no outgoing calls

Tested by 1