mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
fix(supported-version): handle semver-ish values from old magento verisons
This commit is contained in:
Vendored
+21
-21
File diff suppressed because one or more lines are too long
@@ -39,4 +39,15 @@ describe('getUsableVersions for magento-open-source', () => {
|
||||
const versions = getUsableVersions(project);
|
||||
expect(versions).toContain('magento/project-community-edition:2.4.6');
|
||||
});
|
||||
|
||||
it('should handle numeric composer versions', () => {
|
||||
mockGetVersions.mockReturnValue({
|
||||
'magento/project-community-edition:2.3.7-p3': { composer: 1 },
|
||||
'magento/project-community-edition:2.4.6': { composer: 2 }
|
||||
});
|
||||
|
||||
const versions = getUsableVersions(project);
|
||||
expect(versions).not.toContain('magento/project-community-edition:2.3.7-p3');
|
||||
expect(versions).toContain('magento/project-community-edition:2.4.6');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,8 @@ export const getUsableVersions = (project: string): string[] => {
|
||||
*/
|
||||
|
||||
// Packagist retired support for Composer 1 on 2025-09-01.
|
||||
if (value.composer && semver.lt(value.composer.toString(), '2.0.0')) {
|
||||
const composerVersion = semver.coerce(value.composer.toString());
|
||||
if (composerVersion && semver.lt(composerVersion, '2.0.0')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user