mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-17 06:11:20 +00:00
fix: allow matrix testing without EOL versions (#299)
* fix: remove versions dependent on EOL composer 1 * Restore composer 1 versions * Add `usable` version type, filtered by code constraints * Added code comment * Rebuilt index.js with latest changes merged * Updated documentation
This commit is contained in:
committed by
Damien Retzinger
parent
5fd96b988e
commit
5608271fe3
@@ -0,0 +1,22 @@
|
||||
import { PackageMatrixVersion } from '../matrix/matrix-type';
|
||||
import { getIndividualVersionsForProject } from "../versions/get-versions-for-project";
|
||||
import semver from 'semver';
|
||||
|
||||
export const getUsableVersions = (project: string): string[] => {
|
||||
const allVersions = getIndividualVersionsForProject(project)
|
||||
return Object.entries(<Record<string,PackageMatrixVersion>>allVersions)
|
||||
.filter(([key, value]) => {
|
||||
/**
|
||||
* Filter out any versions that are not 'usable', and cannot be successfully installed
|
||||
* anymore for modern systems or other reasons outside our control.
|
||||
*/
|
||||
|
||||
// Packagist retired support for Composer 1 on 2025-09-01.
|
||||
if (value.composer && semver.lt(value.composer.toString(), '2.0.0')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
.map(([key, value]) => key);
|
||||
}
|
||||
Reference in New Issue
Block a user