chore: base

This commit is contained in:
xHyroM 2022-07-11 09:45:23 +02:00
parent b04d87b14c
commit e187173d21
425 changed files with 1080881 additions and 5 deletions

30
src/index.ts Normal file
View file

@ -0,0 +1,30 @@
import { getInput, info, setFailed, setOutput } from '@actions/core';
import getGithubRelease from './utils/getGithubRelease.js';
import install from './utils/install.js';
const exit = (error: string) => {
setFailed(error);
process.exit();
}
const main = async() => {
try {
const version = getInput('bun-version');
const token = getInput('github-token');
if (!version) return exit('Invalid bun version.');
const release = await getGithubRelease(version, token);
if (release?.message === 'Not Found') return exit('Invalid bun version.');
info(`Going to install release ${release.tag_name}`);
await install(release);
setOutput('deno-version', release.tag_name);
} catch(e) {
exit(e);
}
}
main();