Add alias latest

This commit is contained in:
Shivam Mathur
2020-10-02 14:51:40 +05:30
parent 716331904e
commit ebba1db2c3
4 changed files with 49 additions and 5 deletions

View File

@ -22,6 +22,25 @@ export async function getInput(
}
}
/**
* Function to parse PHP version.
*
* @param version
*/
export async function parseVersion(version: string): Promise<string> {
switch (version) {
case 'latest':
return '7.4';
default:
switch (true) {
case version.length > 1:
return version.slice(0, 3);
default:
return version + '.0';
}
}
}
/**
* Async foreach loop
*