mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
feat(supported-version): validate custom_versions
Previously, @danslo reported that he tried to use `custom_versions` without setting the kind. This isn't the correct behavior. I've added a validator to alert him of this.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { customVersionsValidator } from "./validations/custom-versions-validator";
|
||||
import { isKnownKind } from "./validations/is-known-kind";
|
||||
import { KindValidator } from "./validator";
|
||||
|
||||
export const validateKind: KindValidator = (kind, custom_versions = null): boolean => {
|
||||
return validators.reduce((acc, el) => el(kind, custom_versions), true);
|
||||
}
|
||||
|
||||
export const validators: KindValidator[] = [
|
||||
isKnownKind,
|
||||
customVersionsValidator,
|
||||
];
|
||||
Reference in New Issue
Block a user