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

Function resolveNestedImportPathAndOrigin

pkg/parser/import_bfs.go:409–421  ·  view source on GitHub ↗
(item importQueueItem, nestedFilePath string)

Source from the content-addressed store, hash-verified

407}
408
409func resolveNestedImportPathAndOrigin(item importQueueItem, nestedFilePath string) (string, *remoteImportOrigin, error) {
410 if item.remoteOrigin != nil && !isWorkflowSpec(nestedFilePath) {
411 return resolveRemoteNestedPath(item, nestedFilePath)
412 }
413 if isWorkflowSpec(nestedFilePath) {
414 nestedRemoteOrigin := parseRemoteOrigin(nestedFilePath)
415 if nestedRemoteOrigin != nil {
416 importLog.Printf("Nested workflowspec import detected: %s (origin: %s/%s@%s)", nestedFilePath, nestedRemoteOrigin.Owner, nestedRemoteOrigin.Repo, nestedRemoteOrigin.Ref)
417 }
418 return nestedFilePath, nestedRemoteOrigin, nil
419 }
420 return nestedFilePath, nil, nil
421}
422
423func resolveRemoteNestedPath(item importQueueItem, nestedFilePath string) (string, *remoteImportOrigin, error) {
424 cleanPath := path.Clean(strings.TrimPrefix(nestedFilePath, "./"))

Callers 1

enqueueNestedImportEntryFunction · 0.85

Calls 4

resolveRemoteNestedPathFunction · 0.85
parseRemoteOriginFunction · 0.85
isWorkflowSpecFunction · 0.70
PrintfMethod · 0.45

Tested by

no test coverage detected