mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
feat(supported-version): add user-defined kind (#28)
`kind` is a new input property for the `supported-version` action which allows one to define what specific versions of Magento they support. Currently, `kind` supports `latest`, `currently-supported`, and `custom`. See the README for `supported-version` if you want more specifics
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { getMatrixForVersions } from "./get-matrix-for-versions";
|
||||
|
||||
import latestJson from '../kind/latest.json';
|
||||
import currentlySupportedJson from '../kind/currently-supported.json';
|
||||
|
||||
export const getMatrixForKind = (kind: string, versions: string = "") => {
|
||||
switch(kind){
|
||||
case 'latest':
|
||||
return getMatrixForVersions(latestJson);
|
||||
case 'currently-supported':
|
||||
return getMatrixForVersions(currentlySupportedJson);
|
||||
case 'custom':
|
||||
return getMatrixForVersions(versions.split(","))
|
||||
default:
|
||||
throw new Error(`Unreachable kind: ${kind} discovered, please report to the maintainers.`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user