diff --git a/internal/config/rule.go b/internal/config/rule.go index 31bd1aa..b0edd55 100644 --- a/internal/config/rule.go +++ b/internal/config/rule.go @@ -38,6 +38,9 @@ type Rule struct { // Action is the action to take on the filtered notifications. // See github.com/nobe4/internal/actions for list of available actions. Action string `mapstructure:"action"` + + // Args is the arguments to pass to the Action. + Args []string `mapstructure:"args"` } // Test tests the rule for correctness. diff --git a/internal/manager/manager.go b/internal/manager/manager.go index ec443bb..63997e9 100644 --- a/internal/manager/manager.go +++ b/internal/manager/manager.go @@ -128,7 +128,7 @@ func (m *Manager) Apply() error { continue } - if err := runner.Run(notification, nil, os.Stdout); err != nil { + if err := runner.Run(notification, rule.Args, os.Stdout); err != nil { slog.Error("action failed", "action", rule.Action, "err", err) } fmt.Fprintln(os.Stdout, "")