Skip to content

Commit

Permalink
fix: picking correct 6.5 version
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jul 30, 2024
1 parent fa319bc commit 14bef71
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion matrix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ const swToPHP = await (await fetch('https://raw.githubusercontent.com/FriendsOfS
const matrix = [];
const alreadyAddedVersion = new Set();

for (const swVersion of Object.keys(swToPHP).reverse()) {
const customSort = (a, b) => {
const aParts = a.split('.').map(Number);
const bParts = b.split('.').map(Number);

for (let i = 0; i < Math.max(aParts.length, bParts.length); i++) {
if ((aParts[i] || 0) > (bParts[i] || 0)) return -1;
if ((aParts[i] || 0) < (bParts[i] || 0)) return 1;
}
return 0;
};

for (const swVersion of Object.keys(swToPHP).sort(customSort)) {
if ((swVersion.indexOf('6.6') !== 0 && swVersion.indexOf('6.5.8') !== 0) || swVersion.indexOf('RC') !== -1) {
continue;
}
Expand Down

0 comments on commit 14bef71

Please sign in to comment.