mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #1482] Matrix expession evaluated when not expecting it to be #760
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#760
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 @20k-ultra on GitHub (Nov 29, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1482
Bug report info
Command used with act
Describe issue
I have a step in my workflow which uses another job's output as a matrix parameter. The problem is that this job output is null can be null for specific conditions. I protect my step from trying to evaluate null within the matrix by using an if expression.
On Github, this setup is fine and the job is skipped as expected. With act, the job should be skipped also but instead, an error is thrown from not being able to unmarshal nil to JSON.
Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
Here is a link to github run: https://github.com/20k-ultra/action-tester/actions/runs/3580010001
@20k-ultra commented on GitHub (Nov 29, 2022):
By the way, if I set
if: falsefor the step I want to skip, this error is still thrown so I don't think I can add any expression to try and work around this.@20k-ultra commented on GitHub (Nov 29, 2022):
Maybe there's a way I can do something like this if it exists (just tested and it doesn't work but maybe there's a correct way to do this)
@github-actions[bot] commented on GitHub (Jan 29, 2023):
Issue is stale and will be closed in 14 days unless there is new activity
@github-actions[bot] commented on GitHub (Jul 29, 2023):
Issue is stale and will be closed in 14 days unless there is new activity
@vfilenga commented on GitHub (Aug 18, 2023):
I am finding this same bug at this exact moment
EDIT:
Just so you know, I worked around this by always passing at least an empty array "[]" to the matrix job, and also doing a multi-statement if check to make sure the array is not empty, because it was running the matrix job even with an empty array LOL
@ChristopherHX commented on GitHub (Aug 22, 2023):
That's in parity with GitHub Actions (Part of undocumented behavior).
BTW I'm not affected by this problem due to how I use act, so it doesn't gain much attention from my side
@bonzofenix commented on GitHub (Jan 14, 2024):
I found this same issue when I tried to generate the input for the matrix in a dependent job of the main one.
@jsoref commented on GitHub (Nov 12, 2024):
Fwiw, I tripped on what I assume is this this w/ powerdns/pdns w/
act version 0.2.69when runningact -l:github.com/PowerDNS/pdns@4b81e7f615/.github/workflows/build-and-test-all.yml (L367-L447)@ChristopherHX commented on GitHub (Nov 12, 2024):
@jsoref
This would be a different issue due to beeing before running anything, please create a new one.
In this case is act's internal workflow model invalid, yes it is invalid to some extend.
It doesn't even has to do with matrix, act doesn't support expression lists for ports and expression mapping for env.
@Andrej730 commented on GitHub (Oct 28, 2025):
I believe I also came across this -
matrixexpression is still was evaluated, though the job was disabled withif.Example workflow:
Github actions:
act: