[GH-ISSUE #1542] Add support for '${{ inputs.xyz }}' when using the workflow_call event. #777

Closed
opened 2026-03-01 21:46:15 +03:00 by kerem · 3 comments
Owner

Originally created by @mauritsdebruin on GitHub (Jan 3, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1542

Bug report info

act version:            0.2.35
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/maurits/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.18.9
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.35 -X main.commit=e3a722e7c6c697a1b0a38aa314bfb227da4deb5f -X main.date=2023-01-01T02:32:00Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         e3a722e7c6c697a1b0a38aa314bfb227da4deb5f
		vcs.time:             2022-12-26T02:28:46Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Linux Mint 20.3
	OS type:               linux
	OS version:            20.3
	OS arch:               x86_64
	OS kernel:             5.4.0-131-generic
	OS CPU:                8
	OS memory:             31941 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default

Command used with act

act workflow_call --eventpath event.json

Describe issue

When using workflow_call the inputs variable is empty.
This functionality does work when using the workflow_dispatch event type.

Apparently the reason that things work for workflow_dispatch is due to this PR: https://github.com/nektos/act/pull/1363

I am aware that full support for reusable workflows isn't available.
However, it would be really useful if we can at least call individual workflows using the workflow_call event, in order to make the testing of individual workflows possible. The behavior added in the PR can probably be replicated for this event type.

No response

Workflow content

name: "project"
on:
  workflow_call:
    inputs:
      dummy:
        type: string
  workflow_dispatch:
    inputs:
      dummy:
        type: string
jobs:
  test_inputs:
    name: input test
    runs-on: ubuntu-latest
    steps:
      - run: echo "INPUT = ${{ inputs.dummy }}"

Relevant log output

$ act workflow_call --eventpath event.json
[project/input test] 🚀  Start image=catthehacker/ubuntu:act-latest
[project/input test]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[project/input test]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[project/input test]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[project/input test] ⭐ Run Main echo "INPUT = "
[project/input test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| INPUT = 
[project/input test]   ✅  Success - Main echo "INPUT = "
[project/input test] 🏁  Job succeeded
$ act workflow_dispatch --eventpath event.json
[project/input test] 🚀  Start image=catthehacker/ubuntu:act-latest
[project/input test]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[project/input test]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[project/input test]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[project/input test] ⭐ Run Main echo "INPUT = Hello!"
[project/input test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| INPUT = Hello!
[project/input test]   ✅  Success - Main echo "INPUT = Hello!"
[project/input test] 🏁  Job succeeded

Additional information

Event JSON file:

{ "inputs": { "dummy": "Hello!" } }

Originally created by @mauritsdebruin on GitHub (Jan 3, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1542 ### Bug report info ```plain text act version: 0.2.35 GOOS: linux GOARCH: amd64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/maurits/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.9 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.35 -X main.commit=e3a722e7c6c697a1b0a38aa314bfb227da4deb5f -X main.date=2023-01-01T02:32:00Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: e3a722e7c6c697a1b0a38aa314bfb227da4deb5f vcs.time: 2022-12-26T02:28:46Z vcs.modified: false Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Linux Mint 20.3 OS type: linux OS version: 20.3 OS arch: x86_64 OS kernel: 5.4.0-131-generic OS CPU: 8 OS memory: 31941 MB Security options: name=apparmor name=seccomp,profile=default ``` ### Command used with act ```sh act workflow_call --eventpath event.json ``` ### Describe issue When using workflow_call the `inputs` variable is empty. This functionality does work when using the workflow_dispatch event type. Apparently the reason that things work for workflow_dispatch is due to this PR: https://github.com/nektos/act/pull/1363 I am aware that full support for reusable workflows isn't available. However, it would be really useful if we can at least call individual workflows using the workflow_call event, in order to make the testing of individual workflows possible. The behavior added in the PR can probably be replicated for this event type. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: "project" on: workflow_call: inputs: dummy: type: string workflow_dispatch: inputs: dummy: type: string jobs: test_inputs: name: input test runs-on: ubuntu-latest steps: - run: echo "INPUT = ${{ inputs.dummy }}" ``` ### Relevant log output ```sh $ act workflow_call --eventpath event.json [project/input test] 🚀 Start image=catthehacker/ubuntu:act-latest [project/input test] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [project/input test] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [project/input test] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [project/input test] ⭐ Run Main echo "INPUT = " [project/input test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | INPUT = [project/input test] ✅ Success - Main echo "INPUT = " [project/input test] 🏁 Job succeeded $ act workflow_dispatch --eventpath event.json [project/input test] 🚀 Start image=catthehacker/ubuntu:act-latest [project/input test] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [project/input test] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [project/input test] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [project/input test] ⭐ Run Main echo "INPUT = Hello!" [project/input test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | INPUT = Hello! [project/input test] ✅ Success - Main echo "INPUT = Hello!" [project/input test] 🏁 Job succeeded ``` ### Additional information Event JSON file: `{ "inputs": { "dummy": "Hello!" } }`
kerem 2026-03-01 21:46:15 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@EugenioTesio commented on GitHub (Jan 25, 2023):

The --input is not working on my end as well.

Step to reproduce:

  1. git clone https://github.com/EugenioTesio/hello-world-dart-action.git
  2. act -j hello_world_job --input who-to-greet=Eugenio --container-architecture linux/arm64

If you are running on a non M1 chipset machine, you can get rid of --container-architecture linux/arm64

Current output:

[main.yml/A job to say hello] 🚀  Start image=catthehacker/ubuntu:act-latest
[main.yml/A job to say hello]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/arm64 username= forcePull=false
[main.yml/A job to say hello]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main.yml/A job to say hello]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main.yml/A job to say hello] ⭐ Run Main Checkout
[main.yml/A job to say hello]   🐳  docker cp src=/Users/eugeniotesio/development/themonkslab/hello-world-dart-action/. dst=/Users/eugeniotesio/development/themonkslab/hello-world-dart-action
[main.yml/A job to say hello]   ✅  Success - Main Checkout
[main.yml/A job to say hello] ⭐ Run Main Hello world action step
[main.yml/A job to say hello]   🐳  docker pull image=act-dockeraction:latest platform=linux/arm64 username= forcePull=false
[main.yml/A job to say hello]   🐳  docker create image=act-dockeraction:latest platform=linux/arm64 entrypoint=[] cmd=["Mona the Octocat"]
[main.yml/A job to say hello]   🐳  docker run image=act-dockeraction:latest platform=linux/arm64 entrypoint=[] cmd=["Mona the Octocat"]
| Hello Mona the Octocat
| 
[main.yml/A job to say hello]   ⚙  ::set-output:: time=2023-01-25 12:22:06.652950
[main.yml/A job to say hello]   ✅  Success - Main Hello world action step
[main.yml/A job to say hello] ⭐ Run Main Get the output time
[main.yml/A job to say hello]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir=
| The time was 2023-01-25 12:22:06.652950
[main.yml/A job to say hello]   ✅  Success - Main Get the output time
[main.yml/A job to say hello] 🏁  Job succeeded

I should get Hello Eugenio instead of Mona the Octocat.

<!-- gh-comment-id:1403558564 --> @EugenioTesio commented on GitHub (Jan 25, 2023): The --input is not working on my end as well. Step to reproduce: 1. `git clone https://github.com/EugenioTesio/hello-world-dart-action.git` 2. `act -j hello_world_job --input who-to-greet=Eugenio --container-architecture linux/arm64` If you are running on a non M1 chipset machine, you can get rid of `--container-architecture linux/arm64` Current output: ```bash [main.yml/A job to say hello] 🚀 Start image=catthehacker/ubuntu:act-latest [main.yml/A job to say hello] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform=linux/arm64 username= forcePull=false [main.yml/A job to say hello] 🐳 docker create image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main.yml/A job to say hello] 🐳 docker run image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main.yml/A job to say hello] ⭐ Run Main Checkout [main.yml/A job to say hello] 🐳 docker cp src=/Users/eugeniotesio/development/themonkslab/hello-world-dart-action/. dst=/Users/eugeniotesio/development/themonkslab/hello-world-dart-action [main.yml/A job to say hello] ✅ Success - Main Checkout [main.yml/A job to say hello] ⭐ Run Main Hello world action step [main.yml/A job to say hello] 🐳 docker pull image=act-dockeraction:latest platform=linux/arm64 username= forcePull=false [main.yml/A job to say hello] 🐳 docker create image=act-dockeraction:latest platform=linux/arm64 entrypoint=[] cmd=["Mona the Octocat"] [main.yml/A job to say hello] 🐳 docker run image=act-dockeraction:latest platform=linux/arm64 entrypoint=[] cmd=["Mona the Octocat"] | Hello Mona the Octocat | [main.yml/A job to say hello] ⚙ ::set-output:: time=2023-01-25 12:22:06.652950 [main.yml/A job to say hello] ✅ Success - Main Hello world action step [main.yml/A job to say hello] ⭐ Run Main Get the output time [main.yml/A job to say hello] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= | The time was 2023-01-25 12:22:06.652950 [main.yml/A job to say hello] ✅ Success - Main Get the output time [main.yml/A job to say hello] 🏁 Job succeeded ``` I should get Hello Eugenio instead of Mona the Octocat.
Author
Owner

@kunaltyagi commented on GitHub (Apr 7, 2023):

Can confirm on linux/x64

Merely changing workflow_call -> workflow_dispatch for testing allows the workflow to continue as expected

<!-- gh-comment-id:1500051137 --> @kunaltyagi commented on GitHub (Apr 7, 2023): Can confirm on linux/x64 Merely changing workflow_call -> workflow_dispatch for testing allows the workflow to continue as expected
Author
Owner

@GuessWhoSamFoo commented on GitHub (Apr 27, 2023):

Ran into this and would pick this up if no one else is working on it.

<!-- gh-comment-id:1525924619 --> @GuessWhoSamFoo commented on GitHub (Apr 27, 2023): Ran into this and would pick this up if no one else is working on it.
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#777
No description provided.