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 Brauerandmergify[bot] authored and GitHub committed 2022-02-15 20:03:00 +00:00
1 parent d1e0216039
commit ff13844b86
3 files changed
+3 -54

No files matched your search

-7
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
}