Add no-cache option

This commit is contained in:
Max schwenk 2024-02-09 10:54:43 -05:00
parent 8642d99a51
commit 01dacaa127
4 changed files with 22 additions and 14 deletions

View file

@ -14,6 +14,9 @@ inputs:
scope: scope:
required: false required: false
description: "The scope for authenticating with the package registry." description: "The scope for authenticating with the package registry."
disable-cache:
required: false
description: "Disable caching of bun executable."
outputs: outputs:
bun-version: bun-version:
description: The version of Bun that was installed. description: The version of Bun that was installed.

26
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

View file

@ -22,6 +22,7 @@ export type Input = {
profile?: boolean; profile?: boolean;
scope?: string; scope?: string;
registryUrl?: string; registryUrl?: string;
disableCache?: boolean;
}; };
export type Output = { export type Output = {
@ -113,7 +114,10 @@ export default async (options: Input): Promise<Output> => {
}; };
function isCacheEnabled(options: Input): boolean { function isCacheEnabled(options: Input): boolean {
const { customUrl, version } = options; const { customUrl, version, disableCache } = options;
if (disableCache) {
return false;
}
if (customUrl) { if (customUrl) {
return false; return false;
} }

View file

@ -35,6 +35,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,
}) })
.then(({ version, revision, cacheHit }) => { .then(({ version, revision, cacheHit }) => {
setOutput("bun-version", version); setOutput("bun-version", version);