1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

fix #134 - support 'env' context in steps

This commit is contained in:
Casey Lee 2020-03-06 13:39:01 -08:00
parent f9befb34a3
commit 8f6d32db71
4 changed files with 14 additions and 4 deletions

View file

@ -38,21 +38,18 @@ func (sc *StepContext) Executor() common.Executor {
switch step.Type() {
case model.StepTypeRun:
return common.NewPipelineExecutor(
sc.setupEnv(),
sc.setupShellCommand(),
sc.execJobContainer(),
)
case model.StepTypeUsesDockerURL:
return common.NewPipelineExecutor(
sc.setupEnv(),
sc.runUsesContainer(),
)
case model.StepTypeUsesActionLocal:
actionDir := filepath.Join(rc.Config.Workdir, step.Uses)
return common.NewPipelineExecutor(
sc.setupEnv(),
sc.setupAction(actionDir, ""),
sc.runAction(actionDir, ""),
)
@ -72,7 +69,6 @@ func (sc *StepContext) Executor() common.Executor {
Ref: remoteAction.Ref,
Dir: actionDir,
}),
sc.setupEnv(),
sc.setupAction(actionDir, remoteAction.Path),
sc.runAction(actionDir, remoteAction.Path),
)
@ -98,6 +94,7 @@ func (sc *StepContext) setupEnv() common.Executor {
env[k] = rc.ExprEval.Interpolate(v)
}
sc.Env = rc.withGithubEnv(env)
log.Debugf("setupEnv => %v", sc.Env)
return nil
}
}