mirror of
https://github.com/icewind1991/nextcloud-version-matrix.git
synced 2026-06-03 17:44:08 +02:00
support older style php version check
This commit is contained in:
parent
58becf3b4b
commit
ddbeff6b7a
5 changed files with 26 additions and 9 deletions
|
|
@ -82,5 +82,10 @@ Maximum supported server version, as a single-item list
|
|||
|
||||
Minimum supported server version, as a single-item list
|
||||
|
||||
## Building
|
||||
|
||||
- `npm ci`
|
||||
- `./node_modules/.bin/ncc build src/action.js -o dist`
|
||||
|
||||
## License
|
||||
[MIT License](LICENSE.md)
|
||||
|
|
|
|||
10
dist/index.js
vendored
10
dist/index.js
vendored
|
|
@ -42544,8 +42544,14 @@ async function getSupportedVersions(branch) {
|
|||
// yes, this is hacky, but it saves having to keep a list updated
|
||||
let res = await client.get(`https://raw.githubusercontent.com/nextcloud/server/${branch}/lib/versioncheck.php`);
|
||||
let versionCheckCode = await res.readBody();
|
||||
let min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
let max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
let min, max;
|
||||
if (versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)) {
|
||||
min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
} else {
|
||||
min = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) === -1/)[1]);
|
||||
max = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) !== -1/)[1]);
|
||||
}
|
||||
max = parseFloat((max - 0.1).toFixed(1));
|
||||
return {min: min, max: max};
|
||||
}
|
||||
|
|
|
|||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -2,16 +2,16 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1698936415,
|
||||
"narHash": "sha256-RnAVJaiy8utQ6GQIRvStfyHIN95gTp7DVKXbmn9KhWc=",
|
||||
"lastModified": 1721316023,
|
||||
"narHash": "sha256-mvz1IUj3Eh3U7AByQmHU5noEpUbxpMc3qwQ6VJMWaMQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "40c37a9735652cbac03bbef30a1bad7f9edf0e92",
|
||||
"rev": "5d0ced7b8a29f62acd51db3c2a09ce73e3c1d9c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "release-23.05",
|
||||
"ref": "release-24.05",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
inputs = {
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "nixpkgs/release-23.05";
|
||||
nixpkgs.url = "nixpkgs/release-24.05";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,14 @@ async function getSupportedVersions(branch) {
|
|||
// yes, this is hacky, but it saves having to keep a list updated
|
||||
let res = await client.get(`https://raw.githubusercontent.com/nextcloud/server/${branch}/lib/versioncheck.php`);
|
||||
let versionCheckCode = await res.readBody();
|
||||
let min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
let max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
let min, max;
|
||||
if (versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)) {
|
||||
min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
} else {
|
||||
min = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) === -1/)[1]);
|
||||
max = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) !== -1/)[1]);
|
||||
}
|
||||
max = parseFloat((max - 0.1).toFixed(1));
|
||||
return {min: min, max: max};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue