From d068c17d9e2904a5b2c36561a68ad75857c30a22 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 6 Sep 2021 11:58:31 +0530 Subject: [PATCH] Add support for nightly alias --- README.md | 1 + dist/index.js | 2 +- src/configs/php-versions.json | 1 + src/utils.ts | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3610934c..1ff6dcbfa 100644 --- a/README.md +++ b/README.md @@ -371,6 +371,7 @@ Disable coverage for these reasons: - 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 `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 supported PHP versions. diff --git a/dist/index.js b/dist/index.js index 462a52aa1..67c7a81cf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -965,7 +965,7 @@ exports.getManifestURL = getManifestURL; async function parseVersion(version) { const manifest = await getManifestURL(); switch (true) { - case /^(latest|\d+\.x)$/.test(version): + case /^(latest|nightly|\d+\.x)$/.test(version): return JSON.parse((await fetch(manifest))['data'])[version]; default: switch (true) { diff --git a/src/configs/php-versions.json b/src/configs/php-versions.json index 1096a264c..24742cbdb 100644 --- a/src/configs/php-versions.json +++ b/src/configs/php-versions.json @@ -1,5 +1,6 @@ { "latest": "8.0", + "nightly": "8.2", "5.x": "5.6", "7.x": "7.4", "8.x": "8.0" diff --git a/src/utils.ts b/src/utils.ts index eb7167666..cd132ad94 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -102,7 +102,7 @@ export async function getManifestURL(): Promise { export async function parseVersion(version: string): Promise { const manifest = await getManifestURL(); switch (true) { - case /^(latest|\d+\.x)$/.test(version): + case /^(latest|nightly|\d+\.x)$/.test(version): return JSON.parse((await fetch(manifest))['data'])[version]; default: switch (true) {