Refactor to boolean input

This commit is contained in:
Max schwenk 2024-02-09 11:19:50 -05:00
parent 01dacaa127
commit fe6ae30010
3 changed files with 19 additions and 12 deletions

View file

@ -16,6 +16,7 @@ inputs:
description: "The scope for authenticating with the package registry." description: "The scope for authenticating with the package registry."
disable-cache: disable-cache:
required: false required: false
type: boolean
description: "Disable caching of bun executable." description: "Disable caching of bun executable."
outputs: outputs:
bun-version: bun-version:

20
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,13 @@
import { tmpdir } from "node:os"; import { tmpdir } from "node:os";
import { join } from "node:path"; import { join } from "node:path";
import { existsSync, readFileSync } from "node:fs"; import { existsSync, readFileSync } from "node:fs";
import { getInput, setOutput, setFailed, warning } from "@actions/core"; import {
getInput,
setOutput,
setFailed,
warning,
getBooleanInput,
} from "@actions/core";
import runAction from "./action.js"; import runAction from "./action.js";
if (!process.env.RUNNER_TEMP) { if (!process.env.RUNNER_TEMP) {
@ -35,7 +41,7 @@ runAction({
customUrl: getInput("bun-download-url") || undefined, customUrl: getInput("bun-download-url") || undefined,
registryUrl: getInput("registry-url") || undefined, registryUrl: getInput("registry-url") || undefined,
scope: getInput("scope") || undefined, scope: getInput("scope") || undefined,
disableCache: getInput("disable-cache") || undefined, disableCache: getBooleanInput("disable-cache") || undefined,
}) })
.then(({ version, revision, cacheHit }) => { .then(({ version, revision, cacheHit }) => {
setOutput("bun-version", version); setOutput("bun-version", version);