Removed env vars filtering (#1913)

Closes #1911
This commit is contained in:
Thomas Anderson 2023-07-02 20:14:59 +03:00 committed by GitHub
parent eb5c48a85f
commit 2ba64dcb7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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