From ac64dabe8a4f866f3414ef9b065a8efb43ed7b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Mon, 27 May 2024 18:47:06 +0200 Subject: [PATCH] feat: add bun paths and url to output Fixes https://github.com/oven-sh/setup-bun/issues/81 --- action.yml | 5 +++++ src/action.ts | 4 ++++ src/index.ts | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4655f2a..8b5e900 100644 --- a/action.yml +++ b/action.yml @@ -27,8 +27,13 @@ outputs: description: The version of Bun that was installed. bun-revision: 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: description: If the version of Bun was cached. + runs: using: "node20" main: "dist/setup/index.js" diff --git a/src/action.ts b/src/action.ts index bfb1d32..e28e363 100644 --- a/src/action.ts +++ b/src/action.ts @@ -30,6 +30,8 @@ export type Input = { export type Output = { version: string; revision: string; + bunPath: string; + url: string; cacheHit: boolean; }; @@ -111,6 +113,8 @@ export default async (options: Input): Promise => { return { version, revision, + bunPath, + url, cacheHit, }; }; diff --git a/src/index.ts b/src/index.ts index b2d87db..e7578d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,9 +17,11 @@ runAction({ scope: getInput("scope") || undefined, noCache: getBooleanInput("no-cache") || false, }) - .then(({ version, revision, cacheHit }) => { + .then(({ version, revision, bunPath, url, cacheHit }) => { setOutput("bun-version", version); setOutput("bun-revision", revision); + setOutput("bun-path", bunPath); + setOutput("bun-download-url", url); setOutput("cache-hit", cacheHit); process.exit(0); })