-
-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference a null payload value #389
Comments
Your match rule is asserting that the I'm assuming this is a JSON payload. Is the { "head_commit": null } Or is the property not present at all? |
webhook doesn't currently support testing if a value is actually
|
@moorereason thanks for catching that. I've updated my issue to show it is not the string value "null" but instead null. I'm getting the following error when trying to create a NOT rule using the following: "trigger-rule":
{
"not":
{
"match":
{
"type": "value",
"value": "",
"parameter":
{
"source": "payload",
"name": "head_commit"
}
}
}
} couldn't load hooks from file! error unmarshaling JSON: json: cannot unmarshal array into Go struct field Rules.not of type hook.NotRule |
I didn't catch that in your original post, but the "not" value is an array of objects. Try this: "trigger-rule":
{
"not":
[
{
"match":
{
"type": "value",
"value": "",
"parameter":
{
"source": "payload",
"name": "head_commit"
}
}
}
]
} PS - To add formatted code blocks in GitHub, read this page. I edited your last two posts for you. 😃 |
@moorereason thanks again for your response. Unfortunately it is still failing with the same error. Here is my full hook file:
|
Is there any chance to get this implemented? It would help me a lot. |
@volcano1111, I doubt I'll have time to work it in the immediate future. It's not a trivial issue to resolve. I'll add it to the v2.9.0 milestone and hope that we can make it happen. |
@moorereason Check out the |
Haha, I did it guys :) I tried experimenting with different values and
This is a part of json payload it handles:
And here's from log file after executing:
|
Yes, it works because we're serializing nil as |
Following the documentation for implementing a NOT rule. I need to check and make sure the head_commit in the payload is NOT null.
Webhook is not accepting my NOT rule and I'd like to know if there is a known issue with using NOT or if anyone has successfully implemented a NOT rule.
The text was updated successfully, but these errors were encountered: