mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
automod: add default configs for actions
This commit is contained in:
parent
6324b9654b
commit
ae97a5dded
16 changed files with 64 additions and 19 deletions
|
@ -93,6 +93,23 @@ const configPreprocessor: ConfigPreprocessorFn<AutomodPluginType> = options => {
|
|||
}
|
||||
}
|
||||
|
||||
if (rule["actions"]) {
|
||||
for (const actionName in rule["actions"]) {
|
||||
if (!availableActions[actionName]) {
|
||||
throw new StrictValidationError([`Unknown action '${actionName}' in rule '${rule.name}'`]);
|
||||
}
|
||||
|
||||
const actionBlueprint = availableActions[actionName];
|
||||
const actionConfig = rule["actions"][actionName];
|
||||
|
||||
if (typeof actionConfig !== "object" || Array.isArray(actionConfig) || actionConfig == null) {
|
||||
rule["actions"][actionName] = actionConfig;
|
||||
} else {
|
||||
rule["actions"][actionName] = configUtils.mergeConfig(actionBlueprint.defaultConfig, actionConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enable logging of automod actions by default
|
||||
if (rule["actions"]) {
|
||||
for (const actionName in rule.actions) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue