Fix gitURL

This commit is contained in:
CrazyMax 2019-10-11 01:46:14 +02:00
parent a229693815
commit 7c7fc1c5f6
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 6 additions and 8 deletions

View File

@ -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'] || '.');

View File

@ -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}`
]);