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

Function parseRepoFromURL

pkg/cli/outcome_eval.go:334–346  ·  view source on GitHub ↗

parseRepoFromURL extracts owner/repo from a GitHub URL.

(url string)

Source from the content-addressed store, hash-verified

332
333// parseRepoFromURL extracts owner/repo from a GitHub URL.
334func parseRepoFromURL(url string) string {
335 // https://github.com/owner/repo/...
336 const prefix = "github.com/"
337 _, rest, found := strings.Cut(url, prefix)
338 if !found {
339 return ""
340 }
341 parts := strings.SplitN(rest, "/", 3)
342 if len(parts) >= 2 {
343 return parts[0] + "/" + parts[1]
344 }
345 return ""
346}
347
348// isBotUser returns true if the login looks like a bot account.
349func isBotUser(login string) bool {

Callers 2

TestParseRepoFromURLFunction · 0.85
resolveItemRepoFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseRepoFromURLFunction · 0.68