1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

fix 99: support string and map variants of container

This commit is contained in:
Casey Lee 2020-02-24 22:35:08 -08:00
parent f28cd9e692
commit d2ef0e27c7
5 changed files with 63 additions and 5 deletions

View file

@ -87,8 +87,9 @@ func (sc *StepContext) setupEnv() common.Executor {
step := sc.Step
return func(ctx context.Context) error {
var env map[string]string
if job.Container != nil {
env = mergeMaps(rc.GetEnv(), job.Container.Env, step.GetEnv())
c := job.Container()
if c != nil {
env = mergeMaps(rc.GetEnv(), c.Env, step.GetEnv())
} else {
env = mergeMaps(rc.GetEnv(), step.GetEnv())
}