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

Function ExtractBaseRepo

pkg/gitutil/gitutil.go:72–78  ·  view source on GitHub ↗

ExtractBaseRepo extracts the base repository (owner/repo) from a repository path that may include subfolders. For "actions/checkout" -> "actions/checkout" For "github/codeql-action/upload-sarif" -> "github/codeql-action"

(repoPath string)

Source from the content-addressed store, hash-verified

70// For "actions/checkout" -> "actions/checkout"
71// For "github/codeql-action/upload-sarif" -> "github/codeql-action"
72func ExtractBaseRepo(repoPath string) string {
73 parts := strings.Split(repoPath, "/")
74 if len(parts) >= 2 {
75 return parts[0] + "/" + parts[1]
76 }
77 return repoPath
78}
79
80// FindGitRoot finds the root directory of the git repository.
81// Uses pure Go filesystem traversal to avoid requiring the git executable,

Callers 15

TestExtractBaseRepoFunction · 0.92
isExemptFromCoolDownFunction · 0.92
isGhAwNativeActionFunction · 0.92
updateActionsFunction · 0.92
updateSkillRefValueFunction · 0.92
ResolveSHAMethod · 0.92

Calls

no outgoing calls

Tested by 6

TestExtractBaseRepoFunction · 0.74
TestExtractBaseRepoFunction · 0.74
TestExtractBaseRepoFunction · 0.68