Skip to content

Commit

Permalink
Add highest alias as an alternative to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Dec 31, 2023
1 parent dc1a77b commit 43e870b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/configs/php-versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lowest": "8.1",
"highest": "8.3",
"latest": "8.3",
"nightly": "8.4",
"5.x": "5.6",
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function getManifestURL(): Promise<string> {
*/
export async function parseVersion(version: string): Promise<string> {
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
];
Expand Down

0 comments on commit 43e870b

Please sign in to comment.