1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-30 10:11:23 +02:00

quote newlines when interpolating

This commit is contained in:
Brad Rydzewski 2017-01-18 22:59:27 +07:00
parent 2bb64949d1
commit aa48f1f771

View File

@ -96,7 +96,11 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
var err error
w.Yaml, err = envsubst.Eval(w.Yaml, func(s string) string {
return envs[s]
env := envs[s]
if strings.Contains(env, "\n") {
env = fmt.Sprintf("%q", env)
}
return env
})
if err != nil {
return nil, err