1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

fix regression: save env into configEnv

introduced by #3137
This commit is contained in:
6543 2024-01-09 16:28:10 +01:00
parent 02ea3369d5
commit 06538504f8
No known key found for this signature in database
GPG Key ID: B8BE6D610E61C862

View File

@ -39,20 +39,20 @@ func (e *docker) toConfig(step *types.Step) *container.Config {
AttachStdout: true,
AttachStderr: true,
}
env := make(map[string]string)
maps.Copy(env, step.Environment)
configEnv := make(map[string]string)
maps.Copy(configEnv, step.Environment)
if len(step.Commands) != 0 {
env, entry, cmd := common.GenerateContainerConf(step.Commands, e.info.OSType)
for k, v := range env {
env[k] = v
configEnv[k] = v
}
config.Entrypoint = entry
config.Cmd = cmd
}
if len(env) != 0 {
config.Env = toEnv(env)
if len(configEnv) != 0 {
config.Env = toEnv(configEnv)
}
if len(step.Volumes) != 0 {
config.Volumes = toVol(step.Volumes)