mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 05:23:33 +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 {
|
"jira": func() string {
|
||||||
return os.Args[0]
|
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) {
|
"toJson": func(content interface{}) (string, error) {
|
||||||
bytes, err := json.MarshalIndent(content, "", " ")
|
bytes, err := json.MarshalIndent(content, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user