diff --git a/dist/index.js b/dist/index.js index 1d7514bb..809fc665 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2421,9 +2421,14 @@ exports.build = build; */ async function run() { try { + core.warning('setup-php v1 is deprecated.\nPlease upgrade to v2 - https://github.com/shivammathur/setup-php/wiki/Switch-to-v2'); const os_version = process.platform; let version = await utils.getInput('php-version', true); version = version.length > 1 ? version.slice(0, 3) : version + '.0'; + if (version == '8.1') { + core.setFailed('PHP 8.1 is not supported on setup-php v1.\nPlease upgrade to v2 - https://github.com/shivammathur/setup-php/wiki/Switch-to-v2'); + return; + } // check the os version and run the respective script let script_path = ''; switch (os_version) { diff --git a/src/install.ts b/src/install.ts index 83ac911e..ee0bc9f3 100644 --- a/src/install.ts +++ b/src/install.ts @@ -62,9 +62,18 @@ export async function build( */ export async function run(): Promise { try { + core.warning( + 'setup-php v1 is deprecated.\nPlease upgrade to v2 - https://github.com/shivammathur/setup-php/wiki/Switch-to-v2' + ); const os_version: string = process.platform; let version: string = await utils.getInput('php-version', true); version = version.length > 1 ? version.slice(0, 3) : version + '.0'; + if (version == '8.1') { + core.setFailed( + 'PHP 8.1 is not supported on setup-php v1.\nPlease upgrade to v2 - https://github.com/shivammathur/setup-php/wiki/Switch-to-v2' + ); + return; + } // check the os version and run the respective script let script_path = ''; switch (os_version) {