[PR #1009] [MERGED] Expression evaluator fixes #1725

Closed
opened 2026-03-01 21:52:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1009
Author: @ZauberNerd
Created: 2/22/2022
Status: Merged
Merged: 2/25/2022
Merged by: @mergify[bot]

Base: masterHead: expression-evaluator-fixes


📝 Commits (9)

  • 5ba5e41 refactor: remove debug error output
  • 151bc99 refactor: debug log wich expression is going to be evaluated
  • b50c9b9 fix: handle nil in EvalBool
  • c684412 fix: fail on error in if expression and return the evaluation error
  • e161173 fix: remove quotes from inside expression syntax in test
  • 52499d3 refactor: export IsTruthy function from exprparser package
  • bacc0b7 refactor: use IsTruthy function in EvalBool
  • 60d9ad3 refactor: move debug log for expression rewrite to rewrite function
  • 4114460 Merge branch 'master' into expression-evaluator-fixes

📊 Changes

7 files changed (+37 additions, -64 deletions)

View changed files

📝 pkg/common/executor.go (+0 -1)
📝 pkg/exprparser/interpreter.go (+6 -8)
📝 pkg/runner/expression.go (+8 -36)
📝 pkg/runner/run_context.go (+17 -7)
📝 pkg/runner/step_context.go (+1 -7)
📝 pkg/runner/testdata/issue-597/spelling.yaml (+3 -3)
📝 pkg/runner/testdata/uses-composite/push.yml (+2 -2)

📄 Description

This PR contains a few fixes and improvements for the new expression evaluator:

  • Adds more debug output about which expression is going to be evaluated
  • Use exported IsTruthy() function from the exprparser package inside EvalBool()
  • Fail act when an expression contains errors and cannot be evaluated

Fixes: #1008
Ref: #971


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1009 **Author:** [@ZauberNerd](https://github.com/ZauberNerd) **Created:** 2/22/2022 **Status:** ✅ Merged **Merged:** 2/25/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `expression-evaluator-fixes` --- ### 📝 Commits (9) - [`5ba5e41`](https://github.com/nektos/act/commit/5ba5e41a97ef09c3f29d07dd35c13e10af3a1a0c) refactor: remove debug error output - [`151bc99`](https://github.com/nektos/act/commit/151bc9908c1acaa1ae74de1ee8d071f16d041387) refactor: debug log wich expression is going to be evaluated - [`b50c9b9`](https://github.com/nektos/act/commit/b50c9b92a8de2caec380ebd6e2913bd8d3935d54) fix: handle nil in EvalBool - [`c684412`](https://github.com/nektos/act/commit/c68441220d33ee629c716cc205ef812fd72558c3) fix: fail on error in if expression and return the evaluation error - [`e161173`](https://github.com/nektos/act/commit/e1611735320abc792b9def18bd513ae6c009079c) fix: remove quotes from inside expression syntax in test - [`52499d3`](https://github.com/nektos/act/commit/52499d3e1b3158f59f738dcbbb2c0784f9dac471) refactor: export IsTruthy function from exprparser package - [`bacc0b7`](https://github.com/nektos/act/commit/bacc0b77335f35b39df27730d7fb4c5d683b3d00) refactor: use IsTruthy function in EvalBool - [`60d9ad3`](https://github.com/nektos/act/commit/60d9ad3c1ef764ffaba295e8d7282add338717c4) refactor: move debug log for expression rewrite to rewrite function - [`4114460`](https://github.com/nektos/act/commit/4114460996d5cf5127cc7f28b30582f31a86684e) Merge branch 'master' into expression-evaluator-fixes ### 📊 Changes **7 files changed** (+37 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/executor.go` (+0 -1) 📝 `pkg/exprparser/interpreter.go` (+6 -8) 📝 `pkg/runner/expression.go` (+8 -36) 📝 `pkg/runner/run_context.go` (+17 -7) 📝 `pkg/runner/step_context.go` (+1 -7) 📝 `pkg/runner/testdata/issue-597/spelling.yaml` (+3 -3) 📝 `pkg/runner/testdata/uses-composite/push.yml` (+2 -2) </details> ### 📄 Description This PR contains a few fixes and improvements for the new expression evaluator: * Adds more debug output about which expression is going to be evaluated * Use exported `IsTruthy()` function from the `exprparser` package inside `EvalBool()` * Fail act when an expression contains errors and cannot be evaluated Fixes: #1008 Ref: #971 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1725
No description provided.