From 7c7fc1c5f602499b0c65dc78dfc3d07e96504b8c Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 11 Oct 2019 01:46:14 +0200 Subject: [PATCH] Fix gitURL --- lib/main.js | 7 +++---- src/main.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/main.js b/lib/main.js index 3638166..ec0cbf0 100644 --- a/lib/main.js +++ b/lib/main.js @@ -56,21 +56,20 @@ function run() { ]); let gitURL = String('https://'); if (process.env['GITHUB_PAT']) { - gitURL.concat(process.env['GITHUB_PAT']); + gitURL = gitURL.concat(process.env['GITHUB_PAT']); } else if (process.env['GITHUB_TOKEN']) { - gitURL.concat('x-access-token:', process.env['GITHUB_TOKEN']); + gitURL = gitURL.concat('x-access-token:', process.env['GITHUB_TOKEN']); } else { core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT'); return; } - gitURL.concat('@github.com/', repo, '.git'); yield exec.exec('git', [ 'push', '--force', '--quiet', - gitURL, + gitURL.concat('@github.com/', repo, '.git'), `master:${target_branch}` ]); process.chdir(process.env['GITHUB_WORKSPACE'] || '.'); diff --git a/src/main.ts b/src/main.ts index 2d7e06f..98f521d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -46,19 +46,18 @@ async function run() { let gitURL = String('https://'); if (process.env['GITHUB_PAT']) { - gitURL.concat(process.env['GITHUB_PAT']); + gitURL = gitURL.concat(process.env['GITHUB_PAT']); } else if (process.env['GITHUB_TOKEN']) { - gitURL.concat('x-access-token:', process.env['GITHUB_TOKEN']); + gitURL = gitURL.concat('x-access-token:', process.env['GITHUB_TOKEN']); } else { core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT'); return; } - gitURL.concat('@github.com/', repo, '.git'); await exec.exec('git', [ 'push', '--force', '--quiet', - gitURL, + gitURL.concat('@github.com/', repo, '.git'), `master:${target_branch}` ]);