feat: add bun paths and url to output

Fixes https://github.com/oven-sh/setup-bun/issues/81
This commit is contained in:
Jozef Steinhübl 2024-05-27 18:47:06 +02:00
parent 3458468e4c
commit ac64dabe8a
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
3 changed files with 12 additions and 1 deletions

View file

@ -27,8 +27,13 @@ outputs:
description: The version of Bun that was installed. description: The version of Bun that was installed.
bun-revision: bun-revision:
description: The revision of Bun that was installed. description: The revision of Bun that was installed.
bun-path:
description: The path to the Bun executable.
bun-download-url:
description: The URL from which Bun was downloaded.
cache-hit: cache-hit:
description: If the version of Bun was cached. description: If the version of Bun was cached.
runs: runs:
using: "node20" using: "node20"
main: "dist/setup/index.js" main: "dist/setup/index.js"

View file

@ -30,6 +30,8 @@ export type Input = {
export type Output = { export type Output = {
version: string; version: string;
revision: string; revision: string;
bunPath: string;
url: string;
cacheHit: boolean; cacheHit: boolean;
}; };
@ -111,6 +113,8 @@ export default async (options: Input): Promise<Output> => {
return { return {
version, version,
revision, revision,
bunPath,
url,
cacheHit, cacheHit,
}; };
}; };

View file

@ -17,9 +17,11 @@ runAction({
scope: getInput("scope") || undefined, scope: getInput("scope") || undefined,
noCache: getBooleanInput("no-cache") || false, noCache: getBooleanInput("no-cache") || false,
}) })
.then(({ version, revision, cacheHit }) => { .then(({ version, revision, bunPath, url, cacheHit }) => {
setOutput("bun-version", version); setOutput("bun-version", version);
setOutput("bun-revision", revision); setOutput("bun-revision", revision);
setOutput("bun-path", bunPath);
setOutput("bun-download-url", url);
setOutput("cache-hit", cacheHit); setOutput("cache-hit", cacheHit);
process.exit(0); process.exit(0);
}) })