Skip to content

Commit ba06a83

Browse files
committed
Trim token (#25)
1 parent 51a6208 commit ba06a83

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ function run() {
4242
let remote_url = String('https://');
4343
if (process.env['GITHUB_PAT']) {
4444
core.info(`✅ Use GITHUB_PAT`);
45-
remote_url = remote_url.concat(process.env['GITHUB_PAT']);
45+
remote_url = remote_url.concat(process.env['GITHUB_PAT'].trim());
4646
}
4747
else if (process.env['GITHUB_TOKEN']) {
4848
core.info(`✅ Use GITHUB_TOKEN`);
49-
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN']);
49+
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN'].trim());
5050
}
5151
else {
5252
core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT');

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ async function run() {
2626
let remote_url = String('https://');
2727
if (process.env['GITHUB_PAT']) {
2828
core.info(`✅ Use GITHUB_PAT`);
29-
remote_url = remote_url.concat(process.env['GITHUB_PAT']);
29+
remote_url = remote_url.concat(process.env['GITHUB_PAT'].trim());
3030
} else if (process.env['GITHUB_TOKEN']) {
3131
core.info(`✅ Use GITHUB_TOKEN`);
32-
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN']);
32+
remote_url = remote_url.concat('x-access-token:', process.env['GITHUB_TOKEN'].trim());
3333
} else {
3434
core.setFailed('❌️ You have to provide a GITHUB_TOKEN or GITHUB_PAT');
3535
return;

0 commit comments

Comments
 (0)