Add warnings to v1

This commit is contained in:
Shivam Mathur 2020-10-19 14:42:37 +05:30
parent 74cdfb97c1
commit 1ac189066e
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 14 additions and 0 deletions

5
dist/index.js vendored
View File

@ -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) {

View File

@ -62,9 +62,18 @@ export async function build(
*/
export async function run(): Promise<void> {
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) {