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

Function ResolveIncludePath

pkg/parser/remote_fetch.go:198–213  ·  view source on GitHub ↗

ResolveIncludePath resolves include path based on workflowspec format or relative path

(filePath, baseDir string, cache *ImportCache)

Source from the content-addressed store, hash-verified

196
197// ResolveIncludePath resolves include path based on workflowspec format or relative path
198func ResolveIncludePath(filePath, baseDir string, cache *ImportCache) (string, error) {
199 remoteLog.Printf("Resolving include path: file_path=%s, base_dir=%s", filePath, baseDir)
200
201 if builtinPath, handled, err := resolveBuiltinIncludePath(filePath); handled {
202 return builtinPath, err
203 }
204
205 if isWorkflowSpec(filePath) {
206 remoteLog.Printf("Detected workflowspec format: %s", filePath)
207 return downloadIncludeFromWorkflowSpec(filePath, cache)
208 }
209
210 remoteLog.Printf("Using local file resolution for: %s", filePath)
211 resolveBase, securityBase, normalizedFilePath := computeIncludeResolveAndSecurityBases(filePath, baseDir)
212 return resolveAndValidateLocalIncludePath(normalizedFilePath, resolveBase, securityBase)
213}
214
215func resolveBuiltinIncludePath(filePath string) (string, bool, error) {
216 if !strings.HasPrefix(filePath, BuiltinPathPrefix) {

Calls 6

isWorkflowSpecFunction · 0.70
PrintfMethod · 0.45