mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
feat(supported-version): add recent kind (#188)
This commit is contained in:
@@ -5,8 +5,9 @@ import nightlyJson from '../kind/special-versions/nightly.json';
|
||||
import { getDayBefore } from '../nightly/get-day-before';
|
||||
import { getCurrentlySupportedVersions } from "../kind/get-currently-supported";
|
||||
import { amendMatrixForNext } from "../nightly/amend-matrix-for-next";
|
||||
import { getRecentVersions } from "../kind/recent";
|
||||
|
||||
export const getMatrixForKind = (kind: string, project: string, versions = "") => {
|
||||
export const getMatrixForKind = (kind: string, project: string, versions = "", recent_time_frame = '2y') => {
|
||||
|
||||
switch(kind){
|
||||
case 'latest':
|
||||
@@ -19,6 +20,8 @@ export const getMatrixForKind = (kind: string, project: string, versions = "") =
|
||||
return getMatrixForVersions(project, Object.keys(getIndividualVersionsForProject(project)));
|
||||
case 'custom':
|
||||
return getMatrixForVersions(project, versions.split(","))
|
||||
case 'recent':
|
||||
return getMatrixForVersions(project, getRecentVersions(project, new Date(), recent_time_frame));
|
||||
default:
|
||||
throw new Error(`Unreachable kind: ${kind} discovered, please report to the maintainers.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user