From f3f9d1ef58389e9c3dc5c65b6228eb945b97d18d Mon Sep 17 00:00:00 2001 From: Gregor Date: Tue, 4 Jun 2019 15:32:00 -0700 Subject: [PATCH] test: prefix git auth with "x-access-token:" when run in a GitHub Action --- test/get-git-auth-url.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/get-git-auth-url.test.js b/test/get-git-auth-url.test.js index 16b58159..8312d2a0 100644 --- a/test/get-git-auth-url.test.js +++ b/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();