mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-09 00:30:28 +00:00
Report error when if expression is invalid (#485)
Co-authored-by: Ed Tan <[email protected]> Co-authored-by: Casey Lee <[email protected]>
This commit is contained in:
2 files changed
+6
-3
No files matched your search
@@ -314,7 +314,7 @@ func (rc *RunContext) EvalBool(expr string) (bool, error) {
|
||||
joined := strings.Join(evaluatedParts, " ")
|
||||
v, _, err := rc.ExprEval.Evaluate(fmt.Sprintf("Boolean(%s)", joined))
|
||||
if err != nil {
|
||||
return false, nil
|
||||
return false, err
|
||||
}
|
||||
log.Debugf("expression '%s' evaluated to '%s'", expr, v)
|
||||
return v == "true", nil
|
||||
|
||||
Reference in new issue
Block a user