mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 02:30:26 +08:00
Add no-cache option (#58)
This commit is contained in:
parent
0f37bd8169
commit
d3603274ac
@ -39,6 +39,7 @@ In most cases, you shouldn't need to use the [setup-node](https://github.com/act
|
|||||||
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `1.0.x` |
|
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `1.0.x` |
|
||||||
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
||||||
| `scope` | Scope for private packages. | `undefined` | `"@foo"`, `"@orgname"` |
|
| `scope` | Scope for private packages. | `undefined` | `"@foo"`, `"@orgname"` |
|
||||||
|
| `no-cache` | Disable caching of the downloaded executable. | `false` | `true`, `false` |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
@ -14,6 +14,11 @@ 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."
|
||||||
|
no-cache:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: 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.
|
||||||
|
38
dist/setup/index.js
generated
vendored
38
dist/setup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-bun",
|
"name": "setup-bun",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-bun",
|
"name": "setup-bun",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.1.4",
|
"@actions/cache": "^3.1.4",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "setup-bun",
|
"name": "setup-bun",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"description": "Setup Bun on GitHub Actions.",
|
"description": "Setup Bun on GitHub Actions.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"bun",
|
"bun",
|
||||||
|
@ -23,6 +23,7 @@ export type Input = {
|
|||||||
profile?: boolean;
|
profile?: boolean;
|
||||||
scope?: string;
|
scope?: string;
|
||||||
registryUrl?: string;
|
registryUrl?: string;
|
||||||
|
noCache?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Output = {
|
export type Output = {
|
||||||
@ -123,7 +124,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, noCache } = options;
|
||||||
|
if (noCache) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (customUrl) {
|
if (customUrl) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -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,6 +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,
|
||||||
|
noCache: getBooleanInput("no-cache") || false,
|
||||||
})
|
})
|
||||||
.then(({ version, revision, cacheHit }) => {
|
.then(({ version, revision, cacheHit }) => {
|
||||||
setOutput("bun-version", version);
|
setOutput("bun-version", version);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user