mirror of
https://github.com/adnanh/webhook.git
synced 2025-06-04 19:52:29 +00:00
Merge pull request #100 from adnanh/env-names
Do not prefix EnvName with HOOK_
This commit is contained in:
commit
c6530b17e7
3 changed files with 3 additions and 3 deletions
|
@ -367,7 +367,7 @@ func (h *Hook) ExtractCommandArgumentsForEnv(headers, query, payload *map[string
|
||||||
if arg, ok := h.PassEnvironmentToCommand[i].Get(headers, query, payload); ok {
|
if arg, ok := h.PassEnvironmentToCommand[i].Get(headers, query, payload); ok {
|
||||||
if h.PassEnvironmentToCommand[i].EnvName != "" {
|
if h.PassEnvironmentToCommand[i].EnvName != "" {
|
||||||
// first try to use the EnvName if specified
|
// first try to use the EnvName if specified
|
||||||
args = append(args, EnvNamespace+h.PassEnvironmentToCommand[i].EnvName+"="+arg)
|
args = append(args, h.PassEnvironmentToCommand[i].EnvName+"="+arg)
|
||||||
} else {
|
} else {
|
||||||
// then fallback on the name
|
// then fallback on the name
|
||||||
args = append(args, EnvNamespace+h.PassEnvironmentToCommand[i].Name+"="+arg)
|
args = append(args, EnvNamespace+h.PassEnvironmentToCommand[i].Name+"="+arg)
|
||||||
|
|
|
@ -179,7 +179,7 @@ var hookExtractCommandArgumentsForEnvTests = []struct {
|
||||||
"test",
|
"test",
|
||||||
[]Argument{Argument{"header", "a", "MYKEY"}},
|
[]Argument{Argument{"header", "a", "MYKEY"}},
|
||||||
&map[string]interface{}{"a": "z"}, nil, nil,
|
&map[string]interface{}{"a": "z"}, nil, nil,
|
||||||
[]string{"HOOK_MYKEY=z"},
|
[]string{"MYKEY=z"},
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
// failures
|
// failures
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "2.4.0"
|
version = "2.5.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue