mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
fix: add token to install
This commit is contained in:
parent
079e10bfd6
commit
89f6825456
5 changed files with 7 additions and 6 deletions
|
@ -26,7 +26,7 @@ const main = async() => {
|
|||
|
||||
info(`Going to install release ${release.version}`);
|
||||
|
||||
await install(release);
|
||||
await install(release, token);
|
||||
|
||||
setOutput('bun-version', release.tag_name);
|
||||
} catch(e) {
|
||||
|
|
|
@ -37,6 +37,7 @@ export default async(version: string, token: string, fullRepository: string, cus
|
|||
]
|
||||
};
|
||||
}
|
||||
|
||||
const release: any = await (await fetch(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
@ -6,7 +6,7 @@ import getAsset from './getAsset.js';
|
|||
import { join } from 'path';
|
||||
import { homedir } from 'os';
|
||||
|
||||
export default async(release: Release) => {
|
||||
export default async(release: Release, token: string) => {
|
||||
const asset = getAsset(release.assets);
|
||||
const path = join(homedir(), '.bun', 'bin', asset.name);
|
||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||
|
@ -18,7 +18,7 @@ export default async(release: Release) => {
|
|||
|
||||
info(`Downloading Bun from ${asset.asset.browser_download_url}.`);
|
||||
|
||||
const zipPath = await downloadTool(asset.asset.browser_download_url);
|
||||
const zipPath = await downloadTool(asset.asset.browser_download_url, `token ${token}`);
|
||||
const extracted = await extractZip(zipPath, join(homedir(), '.bun', 'bin'));
|
||||
|
||||
const newCache = await cacheDir(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue