Merge pull request #3337 from adrianke77/master

This commit is contained in:
Himanshu Mishra
2020-12-01 09:48:02 +01:00
committed by GitHub
2 changed files with 17 additions and 2 deletions
+12 -2
View File
@@ -146,8 +146,18 @@ export const checkoutGitRepository = async (
if (token) {
const type = getGitRepoType(repoUrl);
const auth = type === 'github' ? `${token}:x-oauth-basic` : `:${token}`;
parsedGitLocation.token = auth;
switch (type) {
case 'gitlab':
// Personal Access Token
parsedGitLocation.token = `dummyUsername:${token}`;
parsedGitLocation.git_suffix = true;
break;
case 'github':
parsedGitLocation.token = `${token}:x-oauth-basic`;
break;
default:
parsedGitLocation.token = `:${token}`;
}
}
const repositoryCheckoutUrl = parsedGitLocation.toString('https');