Skip to content

Commit 2a5c060

Browse files
committed
fix: add warning for when arch is supplied but version is missing
1 parent 2801f51 commit 2a5c060

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dist/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -4645,6 +4645,11 @@ function run() {
46454645
version = core.getInput('version');
46464646
}
46474647
let arch = core.getInput('node-arch');
4648+
// if node-arch supplied but node-version is not
4649+
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
4650+
if (arch && !version) {
4651+
core.warning('`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`');
4652+
}
46484653
if (!arch) {
46494654
arch = os.arch();
46504655
}

src/main.ts

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export async function run() {
1717
}
1818

1919
let arch = core.getInput('node-arch');
20+
21+
// if node-arch supplied but node-version is not
22+
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
23+
if (arch && !version) {
24+
core.warning(
25+
'`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`'
26+
);
27+
}
28+
2029
if (!arch) {
2130
arch = os.arch();
2231
}

0 commit comments

Comments
 (0)