From 252cc2cea65eb45ecc43c185e16a3da7de0c248a Mon Sep 17 00:00:00 2001 From: Piotr Figiela <77412592+Draggu@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:26:13 +0100 Subject: [PATCH] Add option to skip adding to path commit-id:cae6bf83 --- README.md | 3 +++ action.yml | 4 ++++ lib/main.js | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f022c06..d5d323d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ jobs: - `cache` - **Optional**. Boolean. - Enables caching Scarb dependencies. - Empty/not specified: `true`. +- `add-to-path` - **Optional**. Boolean. + - Adds scarb to PATH env. + - Empty/not specified: `true`. ## Outputs diff --git a/action.yml b/action.yml index 743943b..e83ea15 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,10 @@ inputs: description: Enable dependency caching required: false default: "true" + add-to-path: + description: Adds scarb to PATH env + required: false + default: "true" outputs: scarb-prefix: description: The prefix of the installed Scarb diff --git a/lib/main.js b/lib/main.js index ea630ff..9f3b942 100644 --- a/lib/main.js +++ b/lib/main.js @@ -16,6 +16,7 @@ export default async function main() { const toolVersionsPathInput = core.getInput("tool-versions"); const scarbLockPathInput = core.getInput("scarb-lock"); const enableCache = core.getBooleanInput("cache"); + const addToPath = core.getBooleanInput("add-to-path"); const { repo: scarbRepo, version: scarbVersion } = await determineVersion( scarbVersionInput, @@ -38,12 +39,15 @@ export default async function main() { download, "scarb", scarbVersion, - triplet, + triplet ); } core.setOutput("scarb-prefix", scarbPrefix); - core.addPath(path.join(scarbPrefix, "bin")); + + if (addToPath) { + core.addPath(path.join(scarbPrefix, "bin")); + } }, );