check for branched version instead of releases:

This commit is contained in:
Robin Appelman 2023-11-02 17:29:31 +01:00
commit d43cc64aae
2 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ List of version number the app supports
### `branches` ### `branches`
Branches for each supported version, either `stableXX` or `master` for versions that aren't released yet Branches for each supported version, either `stableXX` or `master` for versions that aren't branched yet.
## License ## License
[MIT License](LICENSE.md) [MIT License](LICENSE.md)

View file

@ -4,8 +4,8 @@ const DOMParser = require('xmldom').DOMParser;
const fs = require('fs'); const fs = require('fs');
const urlExist = require('url-exist'); const urlExist = require('url-exist');
function isVersionReleased(version) { function versionHashBranch(version) {
return urlExist(`https://download.nextcloud.com/server/releases/latest-${version}.zip`); return urlExist(`https://github.com/nextcloud/server/tree/stable${version}`);
} }
function range(from, to) { function range(from, to) {
@ -31,7 +31,7 @@ function onlyUnique(value, index, array) {
core.setOutput("versions", JSON.stringify(versions)); core.setOutput("versions", JSON.stringify(versions));
const branches = await Promise.all(versions.map(async (version) => { const branches = await Promise.all(versions.map(async (version) => {
if (await isVersionReleased(version)) { if (await versionHashBranch(version)) {
return `stable${version}`; return `stable${version}`;
} else { } else {
return "master"; return "master";