chore: check if env variable is present to be used as header

see: https://github.com/opentofu/setup-opentofu/pull/16#discussion_r1373416066

Co-authored-by: James Humphries <James@james-humphries.co.uk>
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
This commit is contained in:
Dmitry Kisler 2023-10-26 18:17:20 +02:00
parent 1eab9b2ecb
commit 2ceb5c8897
No known key found for this signature in database
GPG key ID: 46C0A987D58548F6
2 changed files with 2 additions and 2 deletions

2
dist/index.js vendored
View file

@ -41,7 +41,7 @@ async function fetchReleases () {
'X-GitHub-Api-Version': '2022-11-28' 'X-GitHub-Api-Version': '2022-11-28'
}; };
if (process.env.GITHUB_TOKEN !== '') { if (process.env.GITHUB_TOKEN) {
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`; headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
} }

View file

@ -35,7 +35,7 @@ async function fetchReleases () {
'X-GitHub-Api-Version': '2022-11-28' 'X-GitHub-Api-Version': '2022-11-28'
}; };
if (process.env.GITHUB_TOKEN !== '') { if (process.env.GITHUB_TOKEN) {
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`; headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
} }