diff --git a/lib/github.js b/lib/github.js index 8c3436d..fadc3af 100644 --- a/lib/github.js +++ b/lib/github.js @@ -10,7 +10,6 @@ import isURL from 'is-url' const downloadRepo = async repoPath => { const pathParts = gitPathParts(repoPath) - console.log(pathParts) const url = `https://api.github.com/repos/${pathParts.main}/tarball/${pathParts.ref}` const tmpDir = await tmp.dir({ @@ -73,12 +72,17 @@ export const isRepoPath = path => { return false } + const allowedHosts = [ + 'github.com', + 'gitlab.com' + ] + if (isURL(path)) { const urlParts = url.parse(path) const slashCount = (urlParts.path.match(new RegExp('/', 'g')) || []).length const notBare = slashCount >= 2 - if (urlParts.host === 'github.com' && notBare) { + if (allowedHosts.includes(urlParts.host) && notBare) { return true } }