Skip to content

Commit

Permalink
Trim token (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Nov 18, 2019
1 parent 51a6208 commit ba06a83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba06a83

Please sign in to comment.