mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2047] Unable to use expressions for default values in workflow_call inputs #984
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#984
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 @mconigliaro on GitHub (Oct 12, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2047
Bug report info
Command used with act
Describe issue
Expressions are not evaluated in
on.workflow_call.inputs.*.default.Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
No response
@TWiStErRob commented on GitHub (Nov 27, 2023):
Note: as far as I understood, this only affects direct
workflow_calls fromact. If theuses: ./.github/workflows/test.ymlis in another workflow file, andactruns that one, it might "just work".@github-actions[bot] commented on GitHub (May 26, 2024):
Issue is stale and will be closed in 14 days unless there is new activity
@TWiStErRob commented on GitHub (May 26, 2024):
It's never stale, it's a bug that needs to be fixed.
@github-actions[bot] commented on GitHub (Mar 26, 2025):
Issue is stale and will be closed in 14 days unless there is new activity
@TWiStErRob commented on GitHub (Mar 26, 2025):
@ChristopherHX isn't this a standard feature of GHA, or am I missing something? Would you mind elaborating why it's in the not-planned bucket?
@ChristopherHX commented on GitHub (Mar 26, 2025):
I assign my own projects more attention, including a "hard-fork" of act (different package name, includes PRs from me that has been dropped due to missing reviews) and a "replicated" act commandline interface (in c# targets actions/runner).
I had struggle with my planned part last Winter as well, we don't have good communication about the roadmap of act.
I'm not actively working on workflow_call in act
Calling act using event workflow_call is broken by design
The
reviewpart of the label means, I never tried to reproduce this locally. (confirmedwould come after thereviewpart)The
not-plannedpart means this is not somethingIwould work on soon, if someone opens a PR then I would review the change.@mcascone commented on GitHub (Apr 24, 2025):
so...
workflow_calljust doesn't work if you need inputs, and there are no plans to fix it?@ChristopherHX commented on GitHub (Apr 24, 2025):
@mcascone No, you are supposed to use such a yaml to bootstrap your reusable workflow
Now
act push.This should work correctly
IMHO this is not a big deal to do.
@TWiStErRob commented on GitHub (Apr 24, 2025):
Yes and no, for example, we have many
workflow_calls with 10+ inputs and useactto integration test them. So to parameterize those from tests one either has to create many many of these bootstraps (each test) or duplicate all the inputs in the test fixture yml. That said, having an explicit and correct trigger / event context (pushin the above example) is a good thing!@mcascone commented on GitHub (Apr 25, 2025):
ok, so if we use a
pushtrigger it will passwith:inputs from the caller to the called workflow? Because right now, withworkflow_call, I'm seeing it not do that at all. Which really hampers its usability.Is the
_:job name specifically required? What does it do?Is this documented anywhere?
@TWiStErRob how are you using
actto integration test your reusable workflows with this functionality gap in play?@TWiStErRob commented on GitHub (Apr 25, 2025):
https://github.com/nektos/act/issues/2047#issuecomment-1827671287
So I think that's the case, but not 100% sure.
A job name is required there, I like the idea that _ is used, as the name doesn't matter, I usually used
job:in these cases.Don't test defaults: 1. Try to avoid expressions, 2. pass it in explicitly from test, or 3. manually handle expressions:
@mcascone commented on GitHub (Apr 25, 2025):
I'm not sure I completely understand your mechanism, but that's ok. I'm focusing on getting reusable workflows to work with
act/act-js.Perhaps the issue is that I'm starting off the run with a workflow that is itself a reusable workflow? Meaning, an application's repo contains a workflow triggered by
push,pull_request, etc. That workflow calls the "master" pipeline, which is what I'm trying to unit/integration test withact-js.Is it possible that if I kick off the unit-test run with a workflow that uses
push, the reusable workflows called by it will get their inputs properly passed on?@ChristopherHX commented on GitHub (Apr 25, 2025):
tldr in https://github.com/actions-oss/act-cli/actions/runs/14670440643 is "act-cli" creating the workflow I mentioned above itself.
Still this isn't a supported mode of operation.
@mcascone commented on GitHub (Apr 25, 2025):
OK, I created a test-kicker-offer that mimics our calling workflows:
This calls
my-pipelinesuccessfully, with the inputs passed properly through! Win!I also checked that the downstream
workflow_call'flows are called properly, and all of the${{ fromJSON(<a passed-in JSON string>).<object>.<object-key> }}expressions work - even withworkflow_callinputs that are defined in the downstream workflows! Big Win!Thanks all!