Skip to content

Commit

Permalink
fix: use any repoUrl if enterprise flag enabled
Browse files Browse the repository at this point in the history
relates #60
  • Loading branch information
antongolub committed Oct 30, 2019
1 parent 5e3b550 commit 1d652d0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const getRepo = (pluginConfig: TAnyMap, context: TContext, enterprise?: b
const repoName = extractRepoName(repoUrl)
const repoDomain = extractRepoDomain(repoUrl)
const token = getToken(env, repoUrl)
const url = `https://${token}@${repoDomain}/${repoName}.git`

if (process.env.DEBUG) {
logger.log('getRepo:')
Expand All @@ -102,11 +103,15 @@ export const getRepo = (pluginConfig: TAnyMap, context: TContext, enterprise?: b
logger.log('enterprise=', enterprise)
}

if (repoDomain !== 'github.com' && !enterprise) {
return
if (repoDomain === 'github.com' && repoName) {
return url
}

return repoName && `https://${token}@${repoDomain}/${repoName}.git`
if (enterprise) {
return repoName
? url
: repoUrl
}
}

/**
Expand Down

0 comments on commit 1d652d0

Please sign in to comment.