mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Add warnings to v1
This commit is contained in:
parent
74cdfb97c1
commit
1ac189066e
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -2421,9 +2421,14 @@ exports.build = build;
|
|||||||
*/
|
*/
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
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;
|
const os_version = process.platform;
|
||||||
let version = await utils.getInput('php-version', true);
|
let version = await utils.getInput('php-version', true);
|
||||||
version = version.length > 1 ? version.slice(0, 3) : version + '.0';
|
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
|
// check the os version and run the respective script
|
||||||
let script_path = '';
|
let script_path = '';
|
||||||
switch (os_version) {
|
switch (os_version) {
|
||||||
|
@ -62,9 +62,18 @@ export async function build(
|
|||||||
*/
|
*/
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
try {
|
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;
|
const os_version: string = process.platform;
|
||||||
let version: string = await utils.getInput('php-version', true);
|
let version: string = await utils.getInput('php-version', true);
|
||||||
version = version.length > 1 ? version.slice(0, 3) : version + '.0';
|
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
|
// check the os version and run the respective script
|
||||||
let script_path = '';
|
let script_path = '';
|
||||||
switch (os_version) {
|
switch (os_version) {
|
||||||
|
Loading…
Reference in New Issue
Block a user