mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
parent
eb5c48a85f
commit
2ba64dcb7d
1 changed files with 3 additions and 11 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/google/uuid"
|
||||
"github.com/rs/zerolog/log"
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
backend_types "github.com/woodpecker-ci/woodpecker/pipeline/backend/types"
|
||||
"github.com/woodpecker-ci/woodpecker/pipeline/frontend/metadata"
|
||||
|
@ -52,17 +53,8 @@ func (c *Compiler) createProcess(name string, container *yaml_types.Container, s
|
|||
|
||||
// append default environment variables
|
||||
environment := map[string]string{}
|
||||
for k, v := range container.Environment {
|
||||
environment[k] = v
|
||||
}
|
||||
for k, v := range c.env {
|
||||
switch v {
|
||||
case "", "0", "false":
|
||||
continue
|
||||
default:
|
||||
environment[k] = v
|
||||
}
|
||||
}
|
||||
maps.Copy(environment, container.Environment)
|
||||
maps.Copy(environment, c.env)
|
||||
|
||||
environment["CI_WORKSPACE"] = path.Join(c.base, c.path)
|
||||
environment["CI_STEP_NAME"] = name
|
||||
|
|
Loading…
Reference in a new issue