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

cache dir for remote actions

This commit is contained in:
Casey Lee 2020-02-23 22:34:48 -08:00
parent e5680477f9
commit 0f6340f811
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()