Skip to content

Commit

Permalink
fix: don't override env
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfogre committed Feb 15, 2023
1 parent 34ab815 commit e92b6e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ func (rc *RunContext) startHostEnvironment() common.Executor {
}
}
for _, env := range os.Environ() {
i := strings.Index(env, "=")
if i > 0 {
rc.Env[env[0:i]] = env[i+1:]
if k, v, ok := strings.Cut(env, "="); ok {
// don't override
if _, ok := rc.Env[k]; !ok {
rc.Env[k] = v
}
}
}

Expand Down

0 comments on commit e92b6e0

Please sign in to comment.