mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
Add no-cache option
This commit is contained in:
parent
8642d99a51
commit
01dacaa127
4 changed files with 22 additions and 14 deletions
|
@ -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
26
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue