mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-05 10:20:36 +02:00
quote newlines when interpolating
This commit is contained in:
parent
2bb64949d1
commit
aa48f1f771
@ -96,7 +96,11 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
w.Yaml, err = envsubst.Eval(w.Yaml, func(s string) string {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user