fix(executor/local): append env
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m15s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-12-05 13:20:54 -05:00
parent d0c6d27637
commit 7e5dbd733e
GPG Key ID: D47306D7062CDA9D

View File

@ -22,11 +22,11 @@ func (e *Local) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) {
for _, cmd := range cmds {
execCmd := exec.Command(cmd.Args[0], cmd.Args[1:]...) // #nosec G204
if len(cmd.Env) > 0 {
env := os.Environ()
if len(cmd.Env) > 0 {
env = append(env, cmd.Env...)
execCmd.Env = env
}
execCmd.Env = env
if cmd.Stdin != nil {
if cmd.Stdin.Content != nil {