Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip adding to path #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"));
}
},
);

Expand Down
Loading