cache dir for remote actions

This commit is contained in:
Casey Lee
2020-02-23 22:34:48 -08:00
parent 94591c58d7
commit 88041afb87
5 changed files with 76 additions and 111 deletions

View File

@@ -38,6 +38,7 @@ func (sc *StepContext) NewExpressionEvaluator() ExpressionEvaluator {
vm := sc.RunContext.newVM()
configers := []func(*otto.Otto){
sc.vmEnv(),
sc.vmInputs(),
}
for _, configer := range configers {
configer(vm)
@@ -241,6 +242,16 @@ func (sc *StepContext) vmEnv() func(*otto.Otto) {
}
}
func (sc *StepContext) vmInputs() func(*otto.Otto) {
inputs := make(map[string]string)
for k, v := range sc.Step.With {
inputs[k] = v
}
return func(vm *otto.Otto) {
_ = vm.Set("inputs", inputs)
}
}
func (rc *RunContext) vmJob() func(*otto.Otto) {
job := rc.getJobContext()