Skip to content
Permalink
Browse files

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

  • Loading branch information...
gr2m authored and pvdlg committed Jun 4, 2019
1 parent 7e824b2 commit f3f9d1ef58389e9c3dc5c65b6228eb945b97d18d
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/get-git-auth-url.test.js
@@ -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 => {
const {cwd} = await gitRepo();

0 comments on commit f3f9d1e

Please sign in to comment.
You can’t perform that action at this time.