[GH-ISSUE #1926] Change of behavior to pass inputs to manually triggered workflows #925

Open
opened 2026-03-01 21:47:28 +03:00 by kerem · 2 comments
Owner

Originally created by @christinawongseequent on GitHub (Jul 25, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1926

Act version

0.2.48

Feature description

Since GitHub Action has an update of inputs context for both workflow_dispatch and workflow_call. Would you consider adopting the up-to-date GitHub Actions Context in ACT too?

GitHub ref: https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/

Currently, we have to use if condition for all steps and jobs we run locally in ACT, which doesn't seems to serve the purpose of consistence (i.e. we cannot really test the real workflow with if condition only for ACT).

ACT ref: https://github.com/nektos/act#pass-inputs-to-manually-triggered-workflows

Originally created by @christinawongseequent on GitHub (Jul 25, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1926 ### Act version 0.2.48 ### Feature description Since GitHub Action has an update of inputs context for both workflow_dispatch and workflow_call. Would you consider adopting the up-to-date GitHub Actions Context in ACT too? GitHub ref: https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/ Currently, we have to use if condition for all steps and jobs we run locally in ACT, which doesn't seems to serve the purpose of consistence (i.e. we cannot really test the real workflow with if condition only for ACT). ACT ref: https://github.com/nektos/act#pass-inputs-to-manually-triggered-workflows
Author
Owner

@GuessWhoSamFoo commented on GitHub (Jul 30, 2023):

@christinawongseequent Looking into the testcase https://github.com/nektos/act/blob/master/pkg/runner/testdata/workflow_dispatch/workflow_dispatch.yml, this is already supported unless I misunderstood the issue.

e.g. using a modified example from the readme

on:
  workflow_dispatch:
    inputs:
      NAME:
        description: "A random input name for the workflow"
        type: string
      SOME_VALUE:
        description: "Some other input to pass"
        type: string

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest

    steps:
      - name: Test with inputs
        run: |
          echo "Hello ${{ inputs.NAME }} and ${{ inputs.SOME_VALUE }}!"

gets as expected without the event payload:

$ act workflow_dispatch --input NAME=foo --input SOME_VALUE=bar
{"inputs":{"NAME":"foo","SOME_VALUE":"bar"}} test
[example.yml/Test] 🚀  Start image=ghcr.io/catthehacker/ubuntu:full-latest
[example.yml/Test]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:full-latest platform= username= forcePull=true
[example.yml/Test]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[example.yml/Test]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[example.yml/Test] ⭐ Run Main Test with inputs
[example.yml/Test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| Hello foo and bar!
[example.yml/Test]   ✅  Success - Main Test with inputs
[example.yml/Test] 🏁  Job succeeded
sfoo@potato ~/act_examples (main)> act workflow_dispatch --input NAME=foo --input SOME_VALUE=bar    (base) 
[example.yml/Test] 🚀  Start image=ghcr.io/catthehacker/ubuntu:full-latest
[example.yml/Test]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:full-latest platform= username= forcePull=true
[example.yml/Test]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[example.yml/Test]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[example.yml/Test] ⭐ Run Main Test with inputs
[example.yml/Test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| Hello foo and bar!
[example.yml/Test]   ✅  Success - Main Test with inputs
[example.yml/Test] 🏁  Job succeeded
<!-- gh-comment-id:1657284868 --> @GuessWhoSamFoo commented on GitHub (Jul 30, 2023): @christinawongseequent Looking into the testcase https://github.com/nektos/act/blob/master/pkg/runner/testdata/workflow_dispatch/workflow_dispatch.yml, this is already supported unless I misunderstood the issue. e.g. using a modified example from the readme ``` on: workflow_dispatch: inputs: NAME: description: "A random input name for the workflow" type: string SOME_VALUE: description: "Some other input to pass" type: string jobs: test: name: Test runs-on: ubuntu-latest steps: - name: Test with inputs run: | echo "Hello ${{ inputs.NAME }} and ${{ inputs.SOME_VALUE }}!" ``` gets as expected without the event payload: ``` $ act workflow_dispatch --input NAME=foo --input SOME_VALUE=bar {"inputs":{"NAME":"foo","SOME_VALUE":"bar"}} test [example.yml/Test] 🚀 Start image=ghcr.io/catthehacker/ubuntu:full-latest [example.yml/Test] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:full-latest platform= username= forcePull=true [example.yml/Test] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [example.yml/Test] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [example.yml/Test] ⭐ Run Main Test with inputs [example.yml/Test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | Hello foo and bar! [example.yml/Test] ✅ Success - Main Test with inputs [example.yml/Test] 🏁 Job succeeded sfoo@potato ~/act_examples (main)> act workflow_dispatch --input NAME=foo --input SOME_VALUE=bar (base) [example.yml/Test] 🚀 Start image=ghcr.io/catthehacker/ubuntu:full-latest [example.yml/Test] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:full-latest platform= username= forcePull=true [example.yml/Test] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [example.yml/Test] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [example.yml/Test] ⭐ Run Main Test with inputs [example.yml/Test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | Hello foo and bar! [example.yml/Test] ✅ Success - Main Test with inputs [example.yml/Test] 🏁 Job succeeded ```
Author
Owner

@bvanderlugt commented on GitHub (Oct 12, 2023):

I just want to chime in here @GuessWhoSamFoo and add that I think this bug/feature-request is specifically on the workflow_call event. I am working with one right now and I have to switch my workflow to use the workflow_dispatch event to get the inputs to show up (as in your example).

<!-- gh-comment-id:1760361916 --> @bvanderlugt commented on GitHub (Oct 12, 2023): I just want to chime in here @GuessWhoSamFoo and add that I think this bug/feature-request is specifically on the workflow_call event. I am working with one right now and I have to switch my workflow to use the workflow_dispatch event to get the inputs to show up (as in your example).
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#925
No description provided.