mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 13:03:04 +07:00
Add highest alias as an alternative to latest
This commit is contained in:
parent
dc1a77b457
commit
43e870b2d0
@ -390,9 +390,9 @@ Disable coverage for these reasons:
|
|||||||
#### `php-version` (optional)
|
#### `php-version` (optional)
|
||||||
|
|
||||||
- Specify the PHP version you want to set up.
|
- Specify the PHP version you want to set up.
|
||||||
- Accepts a `string`. For example `'8.0'`.
|
- Accepts a `string`. For example `'8.3'`.
|
||||||
- Accepts `latest` to set up the latest stable PHP version.
|
|
||||||
- Accepts `lowest` to set up the lowest supported PHP version.
|
- Accepts `lowest` to set up the lowest supported PHP version.
|
||||||
|
- Accepts `highest` or `latest` to set up the latest stable PHP version.
|
||||||
- Accepts `nightly` to set up a nightly build from the master branch of PHP.
|
- Accepts `nightly` to set up a nightly build from the master branch of PHP.
|
||||||
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
||||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1156,7 +1156,7 @@ async function getManifestURL() {
|
|||||||
exports.getManifestURL = getManifestURL;
|
exports.getManifestURL = getManifestURL;
|
||||||
async function parseVersion(version) {
|
async function parseVersion(version) {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^(latest|lowest|nightly|\d+\.x)$/.test(version):
|
case /^(latest|lowest|highest|nightly|\d+\.x)$/.test(version):
|
||||||
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[version];
|
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[version];
|
||||||
default:
|
default:
|
||||||
switch (true) {
|
switch (true) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"lowest": "8.1",
|
"lowest": "8.1",
|
||||||
|
"highest": "8.3",
|
||||||
"latest": "8.3",
|
"latest": "8.3",
|
||||||
"nightly": "8.4",
|
"nightly": "8.4",
|
||||||
"5.x": "5.6",
|
"5.x": "5.6",
|
||||||
|
@ -59,7 +59,7 @@ export async function getManifestURL(): Promise<string> {
|
|||||||
*/
|
*/
|
||||||
export async function parseVersion(version: string): Promise<string> {
|
export async function parseVersion(version: string): Promise<string> {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^(latest|lowest|nightly|\d+\.x)$/.test(version):
|
case /^(latest|lowest|highest|nightly|\d+\.x)$/.test(version):
|
||||||
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[
|
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[
|
||||||
version
|
version
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user