mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-19 06:41:20 +00:00
b645c2327d
fix: pass correct repo url for nightly The amendMatrixForNext function uses the repository argument to determine the version constraint for the returned matrix for kind nightly. Previously, the upstream-mirror repo url was passed as an argument, but the nightly builds use a different repo url. This resulted in failed builds, because the version string 'next' could not be parsed by composer. Example: https://github.com/mage-os/generate-mirror-repo-js/actions/runs/6370219504/job/17291152703 With this change, the nightly kind will always return the @alpha version constraint, that is, stability constraint. There currently is no way to distinguish between different nightly repos, but since both work the same way, this is fine (for now).
25 lines
1.3 KiB
TypeScript
25 lines
1.3 KiB
TypeScript
import { getMatrixForVersions } from "./get-matrix-for-versions";
|
|
import { getIndividualVersionsForProject } from "../versions/get-versions-for-project";
|
|
import latestJson from '../kind/special-versions/latest.json';
|
|
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";
|
|
|
|
export const getMatrixForKind = (kind: string, project: string, versions = "") => {
|
|
|
|
switch(kind){
|
|
case 'latest':
|
|
return getMatrixForVersions(project, latestJson[project]);
|
|
case 'currently-supported':
|
|
return getMatrixForVersions(project, getCurrentlySupportedVersions(project, new Date()));
|
|
case 'nightly':
|
|
return amendMatrixForNext(getMatrixForVersions(project, nightlyJson[project]), 'https://upstream-nightly.mage-os.org', getDayBefore());
|
|
case 'all':
|
|
return getMatrixForVersions(project, Object.keys(getIndividualVersionsForProject(project)));
|
|
case 'custom':
|
|
return getMatrixForVersions(project, versions.split(","))
|
|
default:
|
|
throw new Error(`Unreachable kind: ${kind} discovered, please report to the maintainers.`);
|
|
}
|
|
} |