mirror of
https://github.com/adnanh/webhook.git
synced 2025-06-28 07:18:31 +00:00
Fix #718
This commit is contained in:
parent
7bb680821d
commit
c2da943240
3 changed files with 21 additions and 20 deletions
|
@ -824,7 +824,7 @@ func (r Rules) Evaluate(req *Request) (bool, error) {
|
|||
return r.Match.Evaluate(req)
|
||||
}
|
||||
|
||||
return false, nil
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// AndRule will evaluate to true if and only if all of the ChildRules evaluate to true
|
||||
|
|
|
@ -351,20 +351,21 @@ func TestHookExtractCommandArguments(t *testing.T) {
|
|||
// we test both cases where the name of the data is used as the name of the
|
||||
// env key & the case where the hook definition sets the env var name to a
|
||||
// fixed value using the envname construct like so::
|
||||
// [
|
||||
// {
|
||||
// "id": "push",
|
||||
// "execute-command": "bb2mm",
|
||||
// "command-working-directory": "/tmp",
|
||||
// "pass-environment-to-command":
|
||||
// [
|
||||
// {
|
||||
// "source": "entire-payload",
|
||||
// "envname": "PAYLOAD"
|
||||
// },
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
//
|
||||
// [
|
||||
// {
|
||||
// "id": "push",
|
||||
// "execute-command": "bb2mm",
|
||||
// "command-working-directory": "/tmp",
|
||||
// "pass-environment-to-command":
|
||||
// [
|
||||
// {
|
||||
// "source": "entire-payload",
|
||||
// "envname": "PAYLOAD"
|
||||
// },
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
var hookExtractCommandArgumentsForEnvTests = []struct {
|
||||
exec string
|
||||
args []Argument
|
||||
|
@ -596,7 +597,7 @@ var andRuleTests = []struct {
|
|||
[]byte{},
|
||||
true, false,
|
||||
},
|
||||
{"empty rule", AndRule{{}}, nil, nil, nil, nil, false, false},
|
||||
{"empty rule", AndRule{{}}, nil, nil, nil, nil, true, false},
|
||||
// failures
|
||||
{
|
||||
"invalid rule",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue