diff --git a/__tests__/setup-dotnet.test.ts b/__tests__/setup-dotnet.test.ts index 7ad8be8..aa8e380 100644 --- a/__tests__/setup-dotnet.test.ts +++ b/__tests__/setup-dotnet.test.ts @@ -16,6 +16,7 @@ describe('setup-dotnet tests', () => { process.env.RUNNER_TOOL_CACHE = toolDir; process.env.DOTNET_INSTALL_DIR = toolDir; process.env.RUNNER_TEMP = tempDir; + process.env['INPUT_INCLUDE-PRERELEASE'] = 'false'; await io.rmRF(toolDir); await io.rmRF(tempDir); }); diff --git a/action.yml b/action.yml index 3c0ecb0..0405e1c 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,7 @@ inputs: include-prerelease: description: 'Whether prerelease versions should be matched with non-exact versions (for example 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not provided.' required: False + default: 'false' runs: using: 'node16' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 1ef7203..d897c56 100644 --- a/dist/index.js +++ b/dist/index.js @@ -478,8 +478,7 @@ function run() { } } if (versions.length) { - const includePrerelease = (core.getInput('include-prerelease') || 'false').toLowerCase() === - 'true'; + const includePrerelease = core.getBooleanInput('include-prerelease'); let dotnetInstaller; for (const version of new Set(versions)) { dotnetInstaller = new installer.DotnetCoreInstaller(version, includePrerelease); diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index 64f3149..2ae0459 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -38,9 +38,9 @@ export async function run() { } if (versions.length) { - const includePrerelease: boolean = - (core.getInput('include-prerelease') || 'false').toLowerCase() === - 'true'; + const includePrerelease: boolean = core.getBooleanInput( + 'include-prerelease' + ); let dotnetInstaller!: installer.DotnetCoreInstaller; for (const version of new Set(versions)) { dotnetInstaller = new installer.DotnetCoreInstaller(