mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-06 21:20:48 +02:00
add {{env.VARNAME}} template support to allow use of env vars
This commit is contained in:
@@ -65,6 +65,14 @@ func TemplateProcessor() *template.Template {
|
||||
"jira": func() string {
|
||||
return os.Args[0]
|
||||
},
|
||||
"env": func() map[string]string {
|
||||
out := map[string]string{}
|
||||
for _, env := range os.Environ() {
|
||||
kv := strings.SplitN(env, "=", 2)
|
||||
out[kv[0]] = kv[1]
|
||||
}
|
||||
return out
|
||||
},
|
||||
"toJson": func(content interface{}) (string, error) {
|
||||
bytes, err := json.MarshalIndent(content, "", " ")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user