Access config in custom Conditions #217
-
Since Unfortunately, I don't see a way to access Is it possible to provide access to the config within |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Providing access would be possible by changing the I'm not sure providing access is to the Do you have an example what you would like to configure for a condition? Maybe a custom Action is more suited? |
Beta Was this translation helpful? Give feedback.
-
What do you think about something like this {
"action": "my-action-bin --some-cool-option",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\DecideByArg",
"args": [
"{$CONFIG|value-of:custom>>should-we-execute-my-action|default:true}"
]
}
]
} The only thing we would have to add is the argument parsing for the If we would provide "exec": "\\CaptainHook\\App\\Hook\\Condition\\DecideByCustomConfigValue",
"args": [
"default-value true|false",
"should-we-execute-my-action"
] The first on is a bit weird the second one a bit more invasive. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I just released version 5.17.2 with both new
You can now build your own by implementing the Hope it helps :) |
Beta Was this translation helpful? Give feedback.
I just released version 5.17.2 with both new
Conditions
.You can now build your own by implementing the
CaptainHook\App\Hook\Condition\ConfigDependant
interface.Hope it helps :)