fix(supported-versions): nightly build matrix tag (#152)

This commit is contained in:
Damien Retzinger
2023-09-24 16:07:37 -04:00
committed by GitHub
parent 88901eacf7
commit 7f1821f6ac
10 changed files with 326 additions and 48 deletions
@@ -0,0 +1,23 @@
import { GithubActionsMatrix } from "../matrix/matrix-type";
import { Repository } from "./repository";
import { unifyNextPackageName } from "./unify-next-package-name";
/**
* A placeholder value use to refer to the next version of Magento.
* This value is just a placeholder, there is no "next" version (as of authoring).
*/
export const nextVersionPlaceHolder = "next";
export const amendMatrixForNext = (matrix: GithubActionsMatrix, repository: Repository, date: Date = new Date()): GithubActionsMatrix => {
const nextVersionRegExp = new RegExp(nextVersionPlaceHolder + '$');
matrix.magento = matrix.magento.map((item) => item.match(nextVersionRegExp) ? unifyNextPackageName(item, repository, date) : item);
matrix.include = matrix.include.map((item) => {
return item.magento.match(nextVersionRegExp)
? {
...item,
magento: unifyNextPackageName(item.magento, repository, date),
}
: item;
});
return matrix;
}