Add more steps context support (#887)
* feat: add more steps context support - Add step outcome - Remove step success in favour of conclusion * feat: add conclusion and outcome steps context tests Add corresponding tests and extend pkg/runner/expression.go vmSteps() to handle steps context conclusion and outcome iota as strings. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
@@ -466,9 +466,19 @@ func (rc *RunContext) vmJob() func(*otto.Otto) {
|
||||
}
|
||||
|
||||
func (rc *RunContext) vmSteps() func(*otto.Otto) {
|
||||
steps := rc.getStepsContext()
|
||||
ctxSteps := rc.getStepsContext()
|
||||
|
||||
steps := make(map[string]interface{})
|
||||
for id, ctxStep := range ctxSteps {
|
||||
steps[id] = map[string]interface{}{
|
||||
"conclusion": ctxStep.Conclusion.String(),
|
||||
"outcome": ctxStep.Outcome.String(),
|
||||
"outputs": ctxStep.Outputs,
|
||||
}
|
||||
}
|
||||
|
||||
return func(vm *otto.Otto) {
|
||||
log.Debugf("context steps => %v", steps)
|
||||
_ = vm.Set("steps", steps)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user