refactor: default empty if: statement to if: success() in evaluator & remove FixIfStatement() (#990)

* refactor: default empty `if:` statement to `if: success()` in evaluator

Previously the code to default an empty `if:` statement in the yaml file
was implemented in different files in the model package.
Now an empty `if:` statement defaults to `success()` in the expression
evaluator.

* refactor: remove obsolete `FixIfStatement` functions

The introduction of the expression evaluator seems to have made these
functions obsolete, as the test case `TestRunEvent/issue-598` works even
without these functions.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Björn Brauer
2022-02-15 21:03:00 +01:00
committed by GitHub
parent d1e0216039
commit ff13844b86
3 changed files with 3 additions and 54 deletions

View File

@@ -90,12 +90,5 @@ func ReadAction(in io.Reader) (*Action, error) {
return nil, err
}
for i := range a.Runs.Steps {
step := &a.Runs.Steps[i]
if step.If.Value == "" {
step.If.Value = "success()"
}
}
return a, nil
}