setup-bun/dist/action.js

18 lines
505 B
JavaScript
Raw Normal View History

2023-02-22 17:47:24 -08:00
import { tmpdir } from "node:os";
import * as action from "@actions/core";
import setup from "./setup.js";
if (!process.env.RUNNER_TEMP) {
2023-02-22 17:51:12 -08:00
process.env.RUNNER_TEMP = tmpdir();
2023-02-22 17:47:24 -08:00
}
setup({
2023-02-22 17:51:12 -08:00
version: action.getInput("bun-version") || undefined,
customUrl: action.getInput("bun-download-url") || undefined,
2023-02-22 17:47:24 -08:00
})
2023-02-22 17:51:12 -08:00
.then(({ version, cacheHit }) => {
2023-02-22 17:47:24 -08:00
action.setOutput("bun-version", version);
action.setOutput("cache-hit", cacheHit);
2023-02-22 17:51:12 -08:00
})
.catch((error) => {
2023-02-22 17:47:24 -08:00
action.setFailed(error);
2023-02-22 17:51:12 -08:00
});