mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-20 21:48:22 +02:00
Add no-cache option (#58)
This commit is contained in:
parent
0f37bd8169
commit
d3603274ac
7 changed files with 41 additions and 24 deletions
|
@ -23,6 +23,7 @@ export type Input = {
|
|||
profile?: boolean;
|
||||
scope?: string;
|
||||
registryUrl?: string;
|
||||
noCache?: boolean;
|
||||
};
|
||||
|
||||
export type Output = {
|
||||
|
@ -123,7 +124,10 @@ export default async (options: Input): Promise<Output> => {
|
|||
};
|
||||
|
||||
function isCacheEnabled(options: Input): boolean {
|
||||
const { customUrl, version } = options;
|
||||
const { customUrl, version, noCache } = options;
|
||||
if (noCache) {
|
||||
return false;
|
||||
}
|
||||
if (customUrl) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
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";
|
||||
|
||||
if (!process.env.RUNNER_TEMP) {
|
||||
|
@ -35,6 +41,7 @@ runAction({
|
|||
customUrl: getInput("bun-download-url") || undefined,
|
||||
registryUrl: getInput("registry-url") || undefined,
|
||||
scope: getInput("scope") || undefined,
|
||||
noCache: getBooleanInput("no-cache") || false,
|
||||
})
|
||||
.then(({ version, revision, cacheHit }) => {
|
||||
setOutput("bun-version", version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue