Skip to content

Commit 3f27154

Browse files
Handle missing booleans
1 parent 3b8222b commit 3f27154

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

dist/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -13667,14 +13667,21 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1366713667
const core = __importStar(__nccwpck_require__(2186));
1366813668
const setup_haskell_1 = __importDefault(__nccwpck_require__(9351));
1366913669
const getToggleInput = (name) => core.getInput(name) !== '';
13670+
const getBooleanInput = (name) => {
13671+
// https://github.com/actions/toolkit/issues/844
13672+
if (!process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`]) {
13673+
return undefined;
13674+
}
13675+
return core.getBooleanInput(name);
13676+
};
1367013677
(0, setup_haskell_1.default)({
1367113678
ghcVersion: core.getInput('ghc-version'),
1367213679
cabalVersion: core.getInput('cabal-version'),
1367313680
stackVersion: core.getInput('stack-version'),
1367413681
enableStack: getToggleInput('enable-stack'),
1367513682
stackNoGlobal: getToggleInput('stack-no-global'),
1367613683
stackSetupGhc: getToggleInput('stack-setup-ghc'),
13677-
cabalUpdate: core.getBooleanInput('cabal-update'),
13684+
cabalUpdate: getBooleanInput('cabal-update'),
1367813685
ghcupReleaseChannels: core.getMultilineInput('ghcup-release-channels'),
1367913686
ghcupReleaseChannel: core.getInput('ghcup-release-channel'),
1368013687
disableMatcher: getToggleInput('disable-matcher')

src/main.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@ import run from './setup-haskell';
33

44
const getToggleInput = (name: string) => core.getInput(name) !== '';
55

6+
const getBooleanInput = (name: string): boolean | undefined => {
7+
// https://github.com/actions/toolkit/issues/844
8+
if (!process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`]) {
9+
return undefined;
10+
}
11+
return core.getBooleanInput(name);
12+
};
13+
614
run({
715
ghcVersion: core.getInput('ghc-version'),
816
cabalVersion: core.getInput('cabal-version'),
917
stackVersion: core.getInput('stack-version'),
1018
enableStack: getToggleInput('enable-stack'),
1119
stackNoGlobal: getToggleInput('stack-no-global'),
1220
stackSetupGhc: getToggleInput('stack-setup-ghc'),
13-
cabalUpdate: core.getBooleanInput('cabal-update'),
21+
cabalUpdate: getBooleanInput('cabal-update'),
1422
ghcupReleaseChannels: core.getMultilineInput('ghcup-release-channels'),
1523
ghcupReleaseChannel: core.getInput('ghcup-release-channel'),
1624
disableMatcher: getToggleInput('disable-matcher')

0 commit comments

Comments
 (0)