[GH-ISSUE #1319] Composite action inputs clobbered #716

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

Originally created by @gdw2 on GitHub (Aug 25, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1319

Originally assigned to: @KnisterPeter on GitHub.

Bug report info

$ act --bug-report
act version:            0.2.30
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:
        /home/gwarner/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
                ubuntu-16.04=catthehacker/ubuntu:act-16.04
Build info:
        Go version:            go1.18.5
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                CGO_ENABLED:          1
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    NixOS 22.05 (Quokka)
        OS type:               linux
        OS version:            22.05
        OS arch:               x86_64
        OS kernel:             5.15.60
        OS CPU:                8
        OS memory:             63521 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -W .github/workflows/pipeline.yaml

Describe issue

In action, ${{ inputs... }} not available after 'using' actions/setup-node or actions/setup-java.

https://github.com/gdw2/act-test

Workflow content

name: Pipeline
on:
  push:

jobs:
  test-orders:
    runs-on: [ viarise ]
    steps:
      - uses: actions/checkout@v2
      - uses: ./.github/actions/test
        with:
          module: some-module


--- (action below) ---

name: Test Action
inputs:
  module:
    required: true
    description: some description

runs:
  using: composite
  steps:
    - shell: bash
      run: |
        echo TEST1 ${{ inputs.module }}
    - uses: actions/setup-node@v2
      with:
        node-version: '16'
    - shell: bash
      run: |
        echo TEST2 ${{ inputs.module }}.   # <-- ⛔️ This isn't echoing.  `inputs` seems to be clobbered by previous step.

Relevant log output

Pipeline/test-orders] 🚀  Start image=nektos/act-environments-ubuntu:18.04
<snip>
| TEST1 some-module
[Pipeline/test-orders]     Success - Main echo TEST1 ${{ inputs.module }}

<snip>
[Pipeline/test-orders]  Runle Main actions/setup-node@v2
<snip>
[Pipeline/test-orders]     ##Success - Main actions/setup-/ode@v2
<snip>
| TEST2         <-- ⛔️ This should say "TEST2 some-module" instead!!!!
<snip>
[Pipeline/test-orders] 🏁  Job succeeded

Additional information

I would expect it to echo "TEST2 some-module", but using actions/setup-node seems to clobber inputs so that ${{ inputs.module }} is empty.

When I run it verbosely, after actions/setup-node, I no longer see INPUT_MODULE being set for subsequent steps.

This works fine on GHA on GHE, which is why I think it might be an act issue.

Originally created by @gdw2 on GitHub (Aug 25, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1319 Originally assigned to: @KnisterPeter on GitHub. ### Bug report info ```plain text $ act --bug-report act version: 0.2.30 GOOS: linux GOARCH: amd64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/gwarner/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 ubuntu-16.04=catthehacker/ubuntu:act-16.04 Build info: Go version: go1.18.5 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc CGO_ENABLED: 1 GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 20.10.17 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: NixOS 22.05 (Quokka) OS type: linux OS version: 22.05 OS arch: x86_64 OS kernel: 5.15.60 OS CPU: 8 OS memory: 63521 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -W .github/workflows/pipeline.yaml ``` ### Describe issue In action, `${{ inputs... }}` not available after 'using' actions/setup-node or actions/setup-java. ### Link to GitHub repository https://github.com/gdw2/act-test ### Workflow content ```yml name: Pipeline on: push: jobs: test-orders: runs-on: [ viarise ] steps: - uses: actions/checkout@v2 - uses: ./.github/actions/test with: module: some-module --- (action below) --- name: Test Action inputs: module: required: true description: some description runs: using: composite steps: - shell: bash run: | echo TEST1 ${{ inputs.module }} - uses: actions/setup-node@v2 with: node-version: '16' - shell: bash run: | echo TEST2 ${{ inputs.module }}. # <-- ⛔️ This isn't echoing. `inputs` seems to be clobbered by previous step. ``` ### Relevant log output ```sh Pipeline/test-orders] 🚀 Start image=nektos/act-environments-ubuntu:18.04 <snip> | TEST1 some-module [Pipeline/test-orders] Success - Main echo TEST1 ${{ inputs.module }} <snip> [Pipeline/test-orders] Runle Main actions/setup-node@v2 <snip> [Pipeline/test-orders] ##Success - Main actions/setup-/ode@v2 <snip> | TEST2 <-- ⛔️ This should say "TEST2 some-module" instead!!!! <snip> [Pipeline/test-orders] 🏁 Job succeeded ``` ### Additional information I would expect it to echo "TEST2 some-module", but using actions/setup-node seems to clobber `inputs` so that `${{ inputs.module }}` is empty. When I run it verbosely, after actions/setup-node, I no longer see `INPUT_MODULE` being set for subsequent steps. **This works fine on GHA on GHE, which is why I think it might be an act issue.**
kerem 2026-03-01 21:45:46 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@gdw2 commented on GitHub (Aug 25, 2022):

I also want to leave open the possibility that I have no idea what I'm doing.

<!-- gh-comment-id:1227781310 --> @gdw2 commented on GitHub (Aug 25, 2022): I also want to leave open the possibility that I have no idea what I'm doing.
Author
Owner

@ChristopherHX commented on GitHub (Aug 25, 2022):

This sounds like an issue of this change github.com/nektos/act@e360811570
Does act v0.2.26 work? The release before composite logic changes.

<!-- gh-comment-id:1227832945 --> @ChristopherHX commented on GitHub (Aug 25, 2022): This sounds like an issue of this change https://github.com/nektos/act/commit/e3608115706382233c3b943b4dabea09bab9d7d2 Does act v0.2.26 work? The release before composite logic changes.
Author
Owner

@SolalVall commented on GitHub (Aug 26, 2022):

Hello Everyone,

I am facing the same issue and I just wanted to confirm that the issue is not present in version 0.2.26. Please find some logs below that compare a similar workflow using the action but with two different versions (0.2.26 & 0.2.30).

Yaml samples

workflow.yml

name: Test workflow
on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Clone
        uses: actions/checkout@v3

      - name: Test action inputs
        uses: ./test/
        with:
          a: foo
          b: bar
          c: foobar

test/action.yml

name:  test

inputs:
  a:
    description: "test input a"
    required: false
  b:
    description: "test input b"
    required: false
  c:
    description: "test input c"
    required: false

runs:
  using: "composite"
  steps:
      - name: Echo inputs (start)
        run: echo "${{ toJSON(inputs) }}"
        shell: bash

      - name: Simple step
        run: echo "do something.."
        shell: bash
        if: inputs.a

      - name: Echo inputs (after run step)
        run: echo "${{ toJSON(inputs) }}"
        shell: bash

      - name: Simple action
        uses: actions/hello-world-docker-action@master
        with:
          who-to-greet: 'Mona the Octocat'

      - name: Echo inputs (after action call without with statement)
        run: echo "${{ toJSON(inputs) }}"
        shell: bash

Results

using act@v0.2.26

[Test workflow/test] ⭐  Run Clone
[Test workflow/test]   ✅  Success - Clone
[Test workflow/test] ⭐  Run Test action inputs
[Test workflow/test] ⭐  Run Echo inputs (start)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir=
| {
|   a: foo,
|   b: bar,
|   c: foobar
| }
[Test workflow/test]   ✅  Success - Echo inputs (start)
[Test workflow/test] ⭐  Run Simple step
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-1.sh] user= workdir=
| do something..
[Test workflow/test]   ✅  Success - Simple step
[Test workflow/test] ⭐  Run Echo inputs (after run step)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-2.sh] user= workdir=
| {
|   a: foo,
|   b: bar,
|   c: foobar
| }
[Test workflow/test]   ✅  Success - Echo inputs (after run step)
[Test workflow/test] ⭐  Run Simple action
[Test workflow/test]   ☁  git clone 'https://github.com/actions/hello-world-docker-action' # ref=master
[Test workflow/test]   🐳  docker pull image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= username= forcePull=false
[Test workflow/test]   🐳  docker create image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"]
[Test workflow/test]   🐳  docker run image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"]
| Hello Mona the Octocat
[Test workflow/test]   ⚙  ::set-output:: time=Fri Aug 26 17:46:49 UTC 2022
[Test workflow/test]   ✅  Success - Simple action
[Test workflow/test] ⭐  Run Echo inputs (after action call without with statement)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-4.sh] user= workdir=
| {
|   a: foo,
|   b: bar,                      <------- THIS IS CORRECT!
|   c: foobar
| }
[Test workflow/test]   ✅  Success - Echo inputs (after action call without with statement)
[Test workflow/test]   ✅  Success - Test action inputs

using act@v0.2.30

[Test workflow/test] ⭐ Run Main Clone
[Test workflow/test]   ✅  Success - Main Clone
[Test workflow/test] ⭐ Run Main Test action inputs
[Test workflow/test] ⭐ Run Main Echo inputs (start)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0] user= workdir=
| {
|   a: foo,
|   b: bar,
|   c: foobar
| }
[Test workflow/test]   ✅  Success - Main Echo inputs (start)
[Test workflow/test] ⭐ Run Main Simple step
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-1] user= workdir=
| do something..
[Test workflow/test]   ✅  Success - Main Simple step
[Test workflow/test] ⭐ Run Main Echo inputs (after run step)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-2] user= workdir=
| {
|   a: foo,
|   b: bar,
|   c: foobar
| }
[Test workflow/test]   ✅  Success - Main Echo inputs (after run step)
[Test workflow/test]   ☁  git clone 'https://github.com/actions/hello-world-docker-action' # ref=master
[Test workflow/test] ⭐ Run Main Simple action
[Test workflow/test]   🐳  docker build -t act-actions-hello-world-docker-action-master-dockeraction:latest /Users/solal/.cache/act/actions-hello-world-docker-action@master
[Test workflow/test]   🐳  docker pull image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= username= forcePull=false
[Test workflow/test]   🐳  docker create image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"]
[Test workflow/test]   🐳  docker run image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"]
| Hello Mona the Octocat
[Test workflow/test]   ⚙  ::set-output:: time=Fri Aug 26 16:34:23 UTC 2022
[Test workflow/test]   ✅  Success - Main Simple action
[Test workflow/test] ⭐ Run Main Echo inputs (after action call without with statement)
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-4] user= workdir=
| {
|   who-to-greet: Mona the Octocat.  <------- THIS IS WRONG!
| }
[Test workflow/test]   ✅  Success - Main Echo inputs (after action call without with statement)
[Test workflow/test]   ✅  Success - Main Test action inputs
[Test workflow/test] ⭐ Run Post Test action inputs
[Test workflow/test]   ✅  Success - Post Test action inputs
[Test workflow/test] 🏁  Job succeeded

Additional details

As you can observe at the end of the output when act@0.2.30 is used, inputs are replaced by the one specified in the previous action.

<!-- gh-comment-id:1228928222 --> @SolalVall commented on GitHub (Aug 26, 2022): Hello Everyone, I am facing the same issue and I just wanted to confirm that the issue is not present in version `0.2.26`. Please find some logs below that compare a similar workflow using the action but with two different versions (`0.2.26` & `0.2.30`). ## Yaml samples ### `workflow.yml` ```yaml name: Test workflow on: push: jobs: test: runs-on: ubuntu-latest steps: - name: Clone uses: actions/checkout@v3 - name: Test action inputs uses: ./test/ with: a: foo b: bar c: foobar ``` ### `test/action.yml` ```yaml name: test inputs: a: description: "test input a" required: false b: description: "test input b" required: false c: description: "test input c" required: false runs: using: "composite" steps: - name: Echo inputs (start) run: echo "${{ toJSON(inputs) }}" shell: bash - name: Simple step run: echo "do something.." shell: bash if: inputs.a - name: Echo inputs (after run step) run: echo "${{ toJSON(inputs) }}" shell: bash - name: Simple action uses: actions/hello-world-docker-action@master with: who-to-greet: 'Mona the Octocat' - name: Echo inputs (after action call without with statement) run: echo "${{ toJSON(inputs) }}" shell: bash ``` ## Results ### using `act@v0.2.26` ``` [Test workflow/test] ⭐ Run Clone [Test workflow/test] ✅ Success - Clone [Test workflow/test] ⭐ Run Test action inputs [Test workflow/test] ⭐ Run Echo inputs (start) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir= | { | a: foo, | b: bar, | c: foobar | } [Test workflow/test] ✅ Success - Echo inputs (start) [Test workflow/test] ⭐ Run Simple step [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-1.sh] user= workdir= | do something.. [Test workflow/test] ✅ Success - Simple step [Test workflow/test] ⭐ Run Echo inputs (after run step) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-2.sh] user= workdir= | { | a: foo, | b: bar, | c: foobar | } [Test workflow/test] ✅ Success - Echo inputs (after run step) [Test workflow/test] ⭐ Run Simple action [Test workflow/test] ☁ git clone 'https://github.com/actions/hello-world-docker-action' # ref=master [Test workflow/test] 🐳 docker pull image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= username= forcePull=false [Test workflow/test] 🐳 docker create image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"] [Test workflow/test] 🐳 docker run image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"] | Hello Mona the Octocat [Test workflow/test] ⚙ ::set-output:: time=Fri Aug 26 17:46:49 UTC 2022 [Test workflow/test] ✅ Success - Simple action [Test workflow/test] ⭐ Run Echo inputs (after action call without with statement) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-4.sh] user= workdir= | { | a: foo, | b: bar, <------- THIS IS CORRECT! | c: foobar | } [Test workflow/test] ✅ Success - Echo inputs (after action call without with statement) [Test workflow/test] ✅ Success - Test action inputs ``` ### using `act@v0.2.30` ``` [Test workflow/test] ⭐ Run Main Clone [Test workflow/test] ✅ Success - Main Clone [Test workflow/test] ⭐ Run Main Test action inputs [Test workflow/test] ⭐ Run Main Echo inputs (start) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0] user= workdir= | { | a: foo, | b: bar, | c: foobar | } [Test workflow/test] ✅ Success - Main Echo inputs (start) [Test workflow/test] ⭐ Run Main Simple step [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-1] user= workdir= | do something.. [Test workflow/test] ✅ Success - Main Simple step [Test workflow/test] ⭐ Run Main Echo inputs (after run step) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-2] user= workdir= | { | a: foo, | b: bar, | c: foobar | } [Test workflow/test] ✅ Success - Main Echo inputs (after run step) [Test workflow/test] ☁ git clone 'https://github.com/actions/hello-world-docker-action' # ref=master [Test workflow/test] ⭐ Run Main Simple action [Test workflow/test] 🐳 docker build -t act-actions-hello-world-docker-action-master-dockeraction:latest /Users/solal/.cache/act/actions-hello-world-docker-action@master [Test workflow/test] 🐳 docker pull image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= username= forcePull=false [Test workflow/test] 🐳 docker create image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"] [Test workflow/test] 🐳 docker run image=act-actions-hello-world-docker-action-master-dockeraction:latest platform= entrypoint=[] cmd=["Mona the Octocat"] | Hello Mona the Octocat [Test workflow/test] ⚙ ::set-output:: time=Fri Aug 26 16:34:23 UTC 2022 [Test workflow/test] ✅ Success - Main Simple action [Test workflow/test] ⭐ Run Main Echo inputs (after action call without with statement) [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-4] user= workdir= | { | who-to-greet: Mona the Octocat. <------- THIS IS WRONG! | } [Test workflow/test] ✅ Success - Main Echo inputs (after action call without with statement) [Test workflow/test] ✅ Success - Main Test action inputs [Test workflow/test] ⭐ Run Post Test action inputs [Test workflow/test] ✅ Success - Post Test action inputs [Test workflow/test] 🏁 Job succeeded ``` ## Additional details As you can observe at the end of the output when `act@0.2.30` is used, inputs are replaced by the one specified in the previous action.
Author
Owner

@KnisterPeter commented on GitHub (Aug 28, 2022):

I will take care of that. Might need a week before I can start looking into it.

<!-- gh-comment-id:1229382533 --> @KnisterPeter commented on GitHub (Aug 28, 2022): I will take care of that. Might need a week before I can start looking into it.
Author
Owner

@ChiwanAhn commented on GitHub (Sep 6, 2022):

it works with act@0.2.31

// try
- ${{ github.event.inputs.key }}
// instead of
+ ${{ inputs.key }}
<!-- gh-comment-id:1237807682 --> @ChiwanAhn commented on GitHub (Sep 6, 2022): it works with `act@0.2.31` ```diff // try - ${{ github.event.inputs.key }} // instead of + ${{ inputs.key }} ```
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#716
No description provided.