From 43e870b2d08a605fdda140cec8aac4c3ef249b78 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 1 Jan 2024 01:26:40 +0530 Subject: [PATCH] Add highest alias as an alternative to latest --- README.md | 4 ++-- dist/index.js | 2 +- src/configs/php-versions.json | 1 + src/utils.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2e6c2355..64c3196d 100644 --- a/README.md +++ b/README.md @@ -390,9 +390,9 @@ Disable coverage for these reasons: #### `php-version` (optional) - Specify the PHP version you want to set up. -- Accepts a `string`. For example `'8.0'`. -- Accepts `latest` to set up the latest stable PHP version. +- Accepts a `string`. For example `'8.3'`. - 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 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. diff --git a/dist/index.js b/dist/index.js index 5544c284..4973cbfa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1156,7 +1156,7 @@ async function getManifestURL() { exports.getManifestURL = getManifestURL; async function parseVersion(version) { 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]; default: switch (true) { diff --git a/src/configs/php-versions.json b/src/configs/php-versions.json index 8bb14306..67ee07ff 100644 --- a/src/configs/php-versions.json +++ b/src/configs/php-versions.json @@ -1,5 +1,6 @@ { "lowest": "8.1", + "highest": "8.3", "latest": "8.3", "nightly": "8.4", "5.x": "5.6", diff --git a/src/utils.ts b/src/utils.ts index a35fb339..79c157d6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -59,7 +59,7 @@ export async function getManifestURL(): Promise { */ export async function parseVersion(version: string): Promise { 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 ];