Skip to content

Commit

Permalink
Add support for nightly alias
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Sep 6, 2021
1 parent 8eebeae commit d068c17
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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 @@
{
"latest": "8.0",
"nightly": "8.2",
"5.x": "5.6",
"7.x": "7.4",
"8.x": "8.0"
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export async function getManifestURL(): Promise<string> {
export async function parseVersion(version: string): Promise<string> {
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) {
Expand Down

0 comments on commit d068c17

Please sign in to comment.