Skip to content

Commit 252cc2c

Browse files
committed
Add option to skip adding to path
commit-id:cae6bf83
1 parent 22f50f6 commit 252cc2c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
- `cache` - **Optional**. Boolean.
4040
- Enables caching Scarb dependencies.
4141
- Empty/not specified: `true`.
42+
- `add-to-path` - **Optional**. Boolean.
43+
- Adds scarb to PATH env.
44+
- Empty/not specified: `true`.
4245

4346
## Outputs
4447

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: Enable dependency caching
1919
required: false
2020
default: "true"
21+
add-to-path:
22+
description: Adds scarb to PATH env
23+
required: false
24+
default: "true"
2125
outputs:
2226
scarb-prefix:
2327
description: The prefix of the installed Scarb

lib/main.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default async function main() {
1616
const toolVersionsPathInput = core.getInput("tool-versions");
1717
const scarbLockPathInput = core.getInput("scarb-lock");
1818
const enableCache = core.getBooleanInput("cache");
19+
const addToPath = core.getBooleanInput("add-to-path");
1920

2021
const { repo: scarbRepo, version: scarbVersion } = await determineVersion(
2122
scarbVersionInput,
@@ -38,12 +39,15 @@ export default async function main() {
3839
download,
3940
"scarb",
4041
scarbVersion,
41-
triplet,
42+
triplet
4243
);
4344
}
4445

4546
core.setOutput("scarb-prefix", scarbPrefix);
46-
core.addPath(path.join(scarbPrefix, "bin"));
47+
48+
if (addToPath) {
49+
core.addPath(path.join(scarbPrefix, "bin"));
50+
}
4751
},
4852
);
4953

0 commit comments

Comments
 (0)