mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
Preservation of forwarded environment
This commit is contained in:
parent
a1518ac5c4
commit
4f1b7eb507
@ -75,8 +75,9 @@ func (p Plugin) exec(host string, wg *sync.WaitGroup, errChannel chan error) {
|
|||||||
env := []string{}
|
env := []string{}
|
||||||
for _, key := range p.Config.Envs {
|
for _, key := range p.Config.Envs {
|
||||||
key = strings.ToUpper(key)
|
key = strings.ToUpper(key)
|
||||||
val := os.Getenv(key)
|
if val, found := os.LookupEnv(key); found {
|
||||||
env = append(env, key+"="+escapeArg(val))
|
env = append(env, key+"="+escapeArg(val))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Config.Script = append(env, p.Config.Script...)
|
p.Config.Script = append(env, p.Config.Script...)
|
||||||
|
Loading…
Reference in New Issue
Block a user