From bd74f676d1b74e859c7583e9325d0ec6536704e8 Mon Sep 17 00:00:00 2001 From: friday Date: Sat, 21 Aug 2021 10:05:47 +0200 Subject: [PATCH 1/2] Tweak logic for which releases are stable * Change validation so only releases with a tags like "1.2.3" are considered stable, and the rest are unstable (pre-releases) * Use tag_name for verifying since name can be missing, and tag_name should have the last version. * Count pre-releases as unstable releases (if they have assets) --- assets/js/releases.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/releases.js b/assets/js/releases.js index 7a5cf03..de25475 100644 --- a/assets/js/releases.js +++ b/assets/js/releases.js @@ -101,8 +101,8 @@ jQuery(function($) { for (var i = 0; i < data.length; i++) { var item = data[i]; var assets = getAssets(item); - var isStable = item.name.indexOf('beta') === -1 && item.name.indexOf(' ') === -1; - if (!item.prerelease && assets && !item.draft && ((stable && isStable) || (!stable && !isStable))) { + var isStable = /^\d+\.\d+\.\d+$/.test(item.tag_name) && !item.prerelease; + if (assets && !item.draft && stable === isStable) { return { name: item.name, tag_name: item.tag_name, From d3f24512c8bdeeeddcd6ba9700ef09fe8f1689b1 Mon Sep 17 00:00:00 2001 From: friday Date: Sat, 21 Aug 2021 10:17:03 +0200 Subject: [PATCH 2/2] Use name first and fallback to tag_name (tag_name is safer to use but can't be revised after making a release) --- assets/js/releases.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/releases.js b/assets/js/releases.js index de25475..63b8841 100644 --- a/assets/js/releases.js +++ b/assets/js/releases.js @@ -101,7 +101,7 @@ jQuery(function($) { for (var i = 0; i < data.length; i++) { var item = data[i]; var assets = getAssets(item); - var isStable = /^\d+\.\d+\.\d+$/.test(item.tag_name) && !item.prerelease; + var isStable = /^\d+\.\d+\.\d+$/.test(item.name || item.tag_name) && !item.prerelease; if (assets && !item.draft && stable === isStable) { return { name: item.name,