test: prefix git auth with "x-access-token:" when run in a GitHub Action

This commit is contained in:
Gregor 2019-06-04 15:32:00 -07:00
parent 7e824b2c18
commit 2569f0bd91

View File

@ -244,6 +244,19 @@ test('Return the "https" formatted URL if "gitCredentials" is defined with "BITB
); );
}); });
test('Return the "https" formatted URL if "GITHUB_ACTION" is set', async t => {
const {cwd} = await gitRepo();
t.is(
await getAuthUrl({
cwd,
env: {...env, GITHUB_ACTION: 'foo', GITHUB_TOKEN: 'token'},
options: {branch: 'master', repositoryUrl: 'git@host.null:owner/repo.git'},
}),
'https://x-access-token:token@host.null/owner/repo.git'
);
});
test('Handle "https" URL with group and subgroup, with "GIT_CREDENTIALS"', async t => { test('Handle "https" URL with group and subgroup, with "GIT_CREDENTIALS"', async t => {
const {cwd} = await gitRepo(); const {cwd} = await gitRepo();