Skip to content

Commit

Permalink
Tweak logic for which releases are stable
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
friday authored Aug 21, 2021
1 parent c0a6eb0 commit bd74f67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bd74f67

Please sign in to comment.