mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #526] Issue: act will parse/evaluate arithmetic context expressions that github wont #356
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#356
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?
Originally created by @dannystaple on GitHub (Feb 9, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/526
Act version
Expected behaviour
The code below, which looks viable, is actually invalid. Run within the genuine github workflow context, it will result in invalid reference and not run the whole workflow file. I would expect act to output the same error for the same line.
Actual behaviour
Act will evaluate this expression to the value. This leads to workflows debugged/developed locally that will not run in github.
Workflow and/or repository
The step definition (minimal reproducible):
Steps to reproduce
Run the above in act (eg
act push), it will run, and echo that calculated time.Commit to github (with the right on definition to function) and it will fail.
@github-actions[bot] commented on GitHub (Mar 12, 2021):
Issue is stale and will be closed in 14 days unless there is new activity
@mikemonkers commented on GitHub (Mar 12, 2021):
I also see this very same issue. It would be nice to align with GitHub or indicate whether GitHub have plans to add support?
@jsoref commented on GitHub (Apr 4, 2021):
Short of reinventing parsing, I can't imagine a good way of handling this. Under the hood, act creates a JavaScript VM (Otto):
github.com/nektos/act@41b03b581chile96e9a5ea27009542a798d4/pkg/runner/expression.go#L34-L37It then asks the VM to evaluate the expression.
*could appear in strings, or in comments. At least the former should be legal in GHA. Not sure about the latter.While I can understand getting bitten by this edge 😦, I'd hate to have to try to write a fix for it 😨.
(There are other nearby edges that I do want to fix...)
@github-actions[bot] commented on GitHub (May 5, 2021):
Issue is stale and will be closed in 14 days unless there is new activity
@ZauberNerd commented on GitHub (Feb 1, 2022):
This has been fixed with: https://github.com/nektos/act/pull/908 and will be released with the next version.
If you want to try it out earlier, use one of the snapshots: https://github.com/nektos/act/actions/runs/1653750680 or install / build from master: https://github.com/nektos/act#go-linuxwindowsmacosany-other-platform-supported-by-go https://github.com/nektos/act#manually-building-from-source