diff --git a/dist/index.js b/dist/index.js index d0a9ab28..92c5761b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -445,8 +445,8 @@ async function run() { } core.warning('setup-php v1 is deprecated.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2'); const version = await utils.parseVersion(await utils.getInput('php-version', true)); - if (version == '8.1') { - core.setFailed('PHP 8.1 is not supported on setup-php v1.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2'); + if (parseFloat(version) < 5.6 || parseFloat(version) > 8.0) { + core.setFailed(`setup-php v1 supports only PHP 5.6 to 8.0.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2`); return; } if (version) { diff --git a/src/install.ts b/src/install.ts index ccb54229..b9103743 100644 --- a/src/install.ts +++ b/src/install.ts @@ -67,9 +67,9 @@ export async function run(): Promise { const version: string = await utils.parseVersion( await utils.getInput('php-version', true) ); - if (version == '8.1') { + if (parseFloat(version) < 5.6 || parseFloat(version) > 8.0) { core.setFailed( - 'PHP 8.1 is not supported on setup-php v1.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2' + `setup-php v1 supports only PHP 5.6 to 8.0.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2` ); return; }