mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 09:35:02 +00:00
Dot syntax
This commit is contained in:
parent
f7eb08c067
commit
a086a24eed
1 changed files with 4 additions and 4 deletions
|
@ -133,20 +133,20 @@ const configPreprocessor: ConfigPreprocessorFn<AutomodPluginType> = options => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule["actions"]) {
|
if (rule.actions) {
|
||||||
if (rule["actions"].change_roles && (rule["actions"].add_roles || rule["actions"].remove_roles)) {
|
if (rule.actions.change_roles && (rule.actions.add_roles || rule.actions.remove_roles)) {
|
||||||
throw new StrictValidationError([
|
throw new StrictValidationError([
|
||||||
`Can't use both 'change_roles' and 'add_roles'/'remove_roles' at rule '${rule.name}'`,
|
`Can't use both 'change_roles' and 'add_roles'/'remove_roles' at rule '${rule.name}'`,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule["actions"].add_roles && rule["actions"].remove_roles) {
|
if (rule.actions.add_roles && rule.actions.remove_roles) {
|
||||||
throw new StrictValidationError([
|
throw new StrictValidationError([
|
||||||
`Can't use both 'add_roles' and 'remove_roles' at rule '${rule.name}', use 'change_roles' instead`,
|
`Can't use both 'add_roles' and 'remove_roles' at rule '${rule.name}', use 'change_roles' instead`,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const actionName in rule["actions"]) {
|
for (const actionName in rule.actions) {
|
||||||
if (!availableActions[actionName]) {
|
if (!availableActions[actionName]) {
|
||||||
throw new StrictValidationError([`Unknown action '${actionName}' in rule '${rule.name}'`]);
|
throw new StrictValidationError([`Unknown action '${actionName}' in rule '${rule.name}'`]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue