mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[PR #424] [MERGED] EvalBool and Interpolation fixes #1446
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1446
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/424
Author: @torbjornvatn
Created: 11/16/2020
Status: ✅ Merged
Merged: 11/17/2020
Merged by: @cplee
Base:
master← Head:eval_and_interpolation📝 Commits (3)
8195cd5A new attempt at Interpolation and EvalBool7151d84One small merge fix57e073eRemove some fmt.Printfs📊 Changes
6 files changed (+762 additions, -117 deletions)
View changed files
➕
.github/workflows/test-expressions.yml(+82 -0)➕
.github/workflows/test-if.yml(+391 -0)📝
pkg/runner/expression.go(+24 -14)📝
pkg/runner/expression_test.go(+74 -7)📝
pkg/runner/run_context.go(+51 -44)📝
pkg/runner/run_context_test.go(+140 -52)📄 Description
I had take another stab at fixing the Interpolation and EvalBool functions so their results match the somewhat weird ones performed by live Github actions.
I've added some auto generated workflows that verifies that the assumptions we make about how Github evaluates stuff is actually true. So the EvalBool test in

run_context_test.gono checks that act evaluates expression and booleans the same as Github does.I had to make some really weird exceptions to make it work though, to me it seems that the expression parser that the Github actions runner either has some bugs or the developers has made some strange design choices.
I've tried to explain the weirdness in the comments here: https://github.com/unacast/act/blob/eval_and_interpolation/pkg/runner/run_context.go#L289
The
test-expressions.ymlandtest-if.ymlworkflow files are auto generated every time the expression and run_context tests are run, to make sure that future changes to the tests (because the code has changed) or to the Github actions runner are detected.Some of the issues that this PR tries to solve are described in #353 and #366
Fixes #353
Fixes #366
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.