Trim token (#25)
This commit is contained in:
parent
51a6208d4a
commit
ba06a833cc
|
@ -42,11 +42,11 @@ function run() {
|
|||
let remote_url = String('https://');
|
||||
if (process.env['GITHUB_PAT']) {
|
||||
core.info(`✅ Use GITHUB_PAT`);
|
||||
remote_url = remote_url.concat(process.env['GITHUB_PAT']);
|
||||
remote_url = remote_url.concat(process.env['GITHUB_PAT'].trim());
|
||||
}
|
||||
else if (process.env['GITHUB_TOKEN']) {
|
||||
core.info(`✅ Use GITHUB_TOKEN`);
|
||||
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN']);
|
||||
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN'].trim());
|
||||
}
|
||||
else {
|
||||
core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT');
|
||||
|
|
|
@ -26,10 +26,10 @@ async function run() {
|
|||
let remote_url = String('https://');
|
||||
if (process.env['GITHUB_PAT']) {
|
||||
core.info(`✅ Use GITHUB_PAT`);
|
||||
remote_url = remote_url.concat(process.env['GITHUB_PAT']);
|
||||
remote_url = remote_url.concat(process.env['GITHUB_PAT'].trim());
|
||||
} else if (process.env['GITHUB_TOKEN']) {
|
||||
core.info(`✅ Use GITHUB_TOKEN`);
|
||||
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN']);
|
||||
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN'].trim());
|
||||
} else {
|
||||
core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user