mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-14 11:53:42 +00:00
fix: don't override env (#1629)
This commit is contained in:
1 parent
34ab8150bf
commit
b0a5068f6d
1 file changed
+5
-3
@@ -186,9 +186,11 @@ func (rc *RunContext) startHostEnvironment() common.Executor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, env := range os.Environ() {
|
for _, env := range os.Environ() {
|
||||||
i := strings.Index(env, "=")
|
if k, v, ok := strings.Cut(env, "="); ok {
|
||||||
if i > 0 {
|
// don't override
|
||||||
rc.Env[env[0:i]] = env[i+1:]
|
if _, ok := rc.Env[k]; !ok {
|
||||||
|
rc.Env[k] = v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user