Skip to content

Commit 1b9cbef

Browse files
committed
fix(action): parse gc-max-store-size correctly
- use length in characters - add missing "break"-s
1 parent aee88ae commit 1b9cbef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/utils/inputs.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export function getInputAsArray(
1515
export function parseNixGcMax(name: string, options?: core.InputOptions) {
1616
const input = core.getInput(name, options);
1717

18-
if (input.length == 0) {
18+
const chars = [...input];
19+
20+
if (chars.length == 0) {
1921
return undefined;
2022
}
2123

22-
const chars = [...input];
23-
2424
let result: number = 0;
2525

2626
for (let i = 0; i < chars.length; i++) {
@@ -33,10 +33,13 @@ export function parseNixGcMax(name: string, options?: core.InputOptions) {
3333
switch (char) {
3434
case "K":
3535
result <<= 10;
36+
break;
3637
case "M":
3738
result <<= 20;
39+
break;
3840
case "G":
3941
result <<= 30;
42+
break;
4043
default:
4144
result = NaN;
4245
}

0 commit comments

Comments
 (0)