isGitHubURL checks if the input looks like a GitHub repo URL
(s string)
| 785 | |
| 786 | // isGitHubURL checks if the input looks like a GitHub repo URL |
| 787 | func isGitHubURL(s string) bool { |
| 788 | s = strings.ToLower(s) |
| 789 | return strings.HasPrefix(s, "github.com/") || |
| 790 | strings.HasPrefix(s, "https://github.com/") || |
| 791 | strings.HasPrefix(s, "http://github.com/") || |
| 792 | strings.HasPrefix(s, "gitlab.com/") || |
| 793 | strings.HasPrefix(s, "https://gitlab.com/") |
| 794 | } |
| 795 | |
| 796 | // cloneRepo clones a git repo to a temp directory (shallow clone) |
| 797 | func cloneRepo(url string, repoName string) (string, error) { |
no outgoing calls