mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
chore: base
This commit is contained in:
parent
b04d87b14c
commit
e187173d21
425 changed files with 1080881 additions and 5 deletions
16
dist/utils/getGithubRelease.js
vendored
Normal file
16
dist/utils/getGithubRelease.js
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { fetch } from 'undici';
|
||||
export default async (version, token) => {
|
||||
let url;
|
||||
if (version === 'latest')
|
||||
url = 'https://api.github.com/repos/oven-sh/bun/releases/latest';
|
||||
else
|
||||
url = `https://api.github.com/repos/oven-sh/bun/releases/tags/bun-v${version}`;
|
||||
const release = await (await fetch(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': 'setup-bun-github-action',
|
||||
'Authorization': token
|
||||
}
|
||||
})).json();
|
||||
return release;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue