From 3f23bbe0317374ca48d12d0a5a456450f8ec1917 Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Sun, 5 Jan 2025 14:52:42 -0800 Subject: [PATCH] Export `BAZELISK_GITHUB_TOKEN` variable Fixes #57 --- config.js | 3 +++ index.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index f304e7a..f8a913a 100644 --- a/config.js +++ b/config.js @@ -123,6 +123,9 @@ if (externalCacheConfig) { } } +const token = core.getInput('token') +core.exportVariable('BAZELISK_GITHUB_TOKEN', token) + module.exports = { baseCacheKey, bazeliskCache: { diff --git a/index.js b/index.js index e01ed01..7cdd7cd 100644 --- a/index.js +++ b/index.js @@ -69,8 +69,7 @@ async function downloadBazelisk() { filename = `${filename}.exe` } - const token = core.getInput('token') - const octokit = github.getOctokit(token, { + const octokit = github.getOctokit(process.env.BAZELISK_GITHUB_TOKEN, { baseUrl: 'https://api.github.com' }) const { data: releases } = await octokit.rest.repos.listReleases({