mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 04:58:25 +02:00
fix: warn if bad version
This commit is contained in:
parent
5a78c10e01
commit
4e76ddea17
5 changed files with 28 additions and 20 deletions
|
@ -15,11 +15,10 @@ export interface Release {
|
|||
version: string;
|
||||
}
|
||||
|
||||
export default async(version: string, token: string): Promise<Release> => {
|
||||
const miscTestBuilds = (getInput('misc-test-builds') === 'true');
|
||||
export default async(version: string, token: string, miscTestBuilds: boolean): Promise<Release> => {
|
||||
const repository = miscTestBuilds ? 'oven-sh/misc-test-builds' : 'oven-sh/bun'
|
||||
let url;
|
||||
if (version === 'latest') url = `https://api.github.com/repos/${repository}/releases/latest`;
|
||||
if (version === 'latest' || miscTestBuilds) url = `https://api.github.com/repos/${repository}/releases/latest`;
|
||||
else url = `https://api.github.com/repos/${repository}/releases/tags/bun-v${version}`;
|
||||
|
||||
const release: any = await (await fetch(url, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue