From 2ba64dcb7d6a150572577dcb7673359560d11162 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Date: Sun, 2 Jul 2023 20:14:59 +0300 Subject: [PATCH] Removed env vars filtering (#1913) Closes #1911 --- pipeline/frontend/yaml/compiler/convert.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pipeline/frontend/yaml/compiler/convert.go b/pipeline/frontend/yaml/compiler/convert.go index c3f45fa3f..e51d15fda 100644 --- a/pipeline/frontend/yaml/compiler/convert.go +++ b/pipeline/frontend/yaml/compiler/convert.go @@ -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