forgejo-runner-act/pkg/common
Björn Brauer c24cfc72f4
Expression evaluator fixes (#1009)
* refactor: remove debug error output

Errors should always be logged with an error level and not debug level.
Since the error is returned here, it will be logged later as an error.
Presumably this was a leftover from debugging the executor chain in:
PR: #971

* refactor: debug log wich expression is going to be evaluated

* fix: handle nil in EvalBool

We've seen this issue when the env map is not set-up properly,
i.e. when the env map is nil, EvalBool might return nil, which should
be handled as a falsy value.

* fix: fail on error in if expression and return the evaluation error

Stop running the workflow in case an expression cannot be evaluated.

Fixes: #1008

* fix: remove quotes from inside expression syntax in test

It looks like having an expression inside double quotes inside the
expression syntax is not valid: https://github.com/ZauberNerd/act-test/actions/runs/1881986429
The workflow is not valid. .github/workflows/test.yml (Line: 10, Col: 13): Unexpected symbol: '"endsWith'. Located at position 1 within expression: "endsWith('Hello world', 'ld')"

* refactor: export IsTruthy function from exprparser package

* refactor: use IsTruthy function in EvalBool

* refactor: move debug log for expression rewrite to rewrite function

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-25 18:39:50 +00:00
..
cartesian.go Fix Cartesian product to return empty set if empty set is given (#503) 2021-01-23 14:55:54 -08:00
cartesian_test.go Fix indent with go fmt (#531) 2021-02-17 11:47:59 -08:00
draw.go GitHub env file support (#426) 2021-01-11 22:39:43 -08:00
dryrun.go successfully able to run simple workflows 2020-02-20 21:05:25 -05:00
executor.go Expression evaluator fixes (#1009) 2022-02-25 18:39:50 +00:00
executor_test.go Clean the repository cache if it is in incomplete state (#595) 2021-04-06 06:43:02 -07:00
file.go Add super-linter + fix lint issues (#650) 2021-05-03 09:52:03 -07:00
git.go Fix github SSH regex for missing .git extension (#871) 2021-11-13 14:56:31 +00:00
git_test.go Fix github SSH regex for missing .git extension (#871) 2021-11-13 14:56:31 +00:00
job_error.go fix: continue jobs + steps after failure (#840) 2021-12-08 20:57:42 +00:00
line_writer.go integration test 2020-02-24 12:48:12 -08:00
line_writer_test.go integration test 2020-02-24 12:48:12 -08:00
logger.go successfully able to run simple workflows 2020-02-20 21:05:25 -05:00
outbound_ip.go Asset server implementation (#677) 2021-11-10 09:57:22 -08:00
testflag.go feat: allow existing logger from context (#898) 2021-11-27 17:45:56 +00:00