[GH-ISSUE #2697] Job getting composite action's output variable with wrong key #1216

Open
opened 2026-03-01 21:49:45 +03:00 by kerem · 0 comments
Owner

Originally created by @ErnestoArtigas on GitHub (Mar 17, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2697

Bug report info

act version:            0.2.75
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        \\.\pipe\docker_engine(broken)
Config files:
        C:\Users\MyUser\AppData\Local\act\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.23.6
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.75 -X main.commit=bd97dc8d9422a8b04e6193c6c86afa8a7a693fdf -X main.date=2025-03-01T02:31:09Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         bd97dc8d9422a8b04e6193c6c86afa8a7a693fdf
                vcs.time:             2025-03-01T02:30:53Z
                vcs.modified:         false
Docker Engine:
        Engine version:        28.0.1
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.153.1-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             15946 MB
        Security options:
                name=seccomp,profile=unconfined

Command used with act

act -W .\.github\workflows\test-workflow.yaml

Describe issue

I've found a bug, where you can use a composite action's output variable with the wrong name in act, whereas on github actions' runner it won't be picked up.

In this stripped down code, I have a workflow, called test-workflow, that calls the composite action composite-action.

The composite action outputs a value, dummy_variable, from the step dummy_step own outputted variable that is called value.

The workflow calls the composite action in composite_step, then outputs the dumy_variable with the path steps.composite_step.outputs.value:

[Test workflow/test] ⭐ Run Main Launch composite action
[Test workflow/test]   ⚙  ::set-output:: dummy_variable=dummy_variable
[Test workflow/test]   ✅  Success - Main Launch composite action
[Test workflow/test]   ⚙  ::set-output:: value=dummy_variable
[Test workflow/test] ⭐ Run Main echo output dummy_variable
[Test workflow/test]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir=
| output dummy_variable
[Test workflow/test]   ✅  Success - Main echo output dummy_variable

Because the path is wrong, on github actions' runner, the variable isn't picked up and outputs output, without dummy_variable:

2025-03-17T18:07:29.2844255Z ##[group]Run ./.github/actions/composite-action
2025-03-17T18:07:29.2845519Z ##[endgroup]
2025-03-17T18:07:29.2958551Z ##[group]Run echo "value=dummy_variable" >> $GITHUB_OUTPUT
2025-03-17T18:07:29.2960196Z echo "value=dummy_variable" >> $GITHUB_OUTPUT
2025-03-17T18:07:29.3015023Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-03-17T18:07:29.3016468Z ##[endgroup]
2025-03-17T18:07:29.3265871Z ##[group]Run echo output 
2025-03-17T18:07:29.3266858Z echo output 
2025-03-17T18:07:29.3318319Z shell: /usr/bin/bash -e {0}
2025-03-17T18:07:29.3319284Z ##[endgroup]
2025-03-17T18:07:29.3400444Z output

Fixing the path from outputs.value to outputst.dummy_variable, such as:

      - run: echo output ${{ steps.composite_step.outputs.dummy_variable }}

Doesn't change anything in act:

[Test workflow/test] ⭐ Run Main Launch composite action
[Test workflow/test] ⭐ Run Main echo "value=dummy_variable" >> $GITHUB_OUTPUT
[Test workflow/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/composite_step-composite-dummy_step.sh] user= workdir=
[Test workflow/test]   ✅  Success - Main echo "value=dummy_variable" >> $GITHUB_OUTPUT
[Test workflow/test]   ⚙  ::set-output:: value=dummy_variable
[Test workflow/test]   ⚙  ::set-output:: dummy_variable=dummy_variable
[Test workflow/test]   ✅  Success - Main Launch composite action
[Test workflow/test]   ⚙  ::set-output:: value=dummy_variable
[Test workflow/test] ⭐ Run Main echo output dummy_variable
[Test workflow/test]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir=
| output dummy_variable
[Test workflow/test]   ✅  Success - Main echo output dummy_variable

And fixes it on github actions' runner

2025-03-17T18:15:00.7710134Z ##[group]Run ./.github/actions/composite-action
2025-03-17T18:15:00.7710702Z ##[endgroup]
2025-03-17T18:15:00.7809083Z ##[group]Run echo "value=dummy_variable" >> $GITHUB_OUTPUT
2025-03-17T18:15:00.7809926Z echo "value=dummy_variable" >> $GITHUB_OUTPUT
2025-03-17T18:15:00.7863255Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-03-17T18:15:00.7863966Z ##[endgroup]
2025-03-17T18:15:00.8084564Z ##[group]Run echo output dummy_variable
2025-03-17T18:15:00.8085187Z echo output dummy_variable
2025-03-17T18:15:00.8134300Z shell: /usr/bin/bash -e {0}
2025-03-17T18:15:00.8134790Z ##[endgroup]
2025-03-17T18:15:00.8208227Z output dummy_variable

No response

Workflow content

# Test workflow
name: Test workflow

on:
  push:
    branches:
      - "main"

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Launch composite action
        id: composite_step
        uses: ./.github/actions/composite-action

      - run: echo output ${{ steps.composite_step.outputs.value }}

# Composite action
name: Composite action
description: Composite action

outputs:
  dummy_variable:
    description: Dummy variable
    value: ${{ steps.dummy_step.outputs.value }}

runs:
  using: composite

  steps:
    - id: dummy_step
      shell: bash
      run: echo "value=dummy_variable" >> $GITHUB_OUTPUT

Relevant log output

Because there were multiple logs, they are included in the Describe issue paragraph

Additional information

No response

Originally created by @ErnestoArtigas on GitHub (Mar 17, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2697 ### Bug report info ```plain text act version: 0.2.75 GOOS: windows GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is not set Sockets found: \\.\pipe\docker_engine(broken) Config files: C:\Users\MyUser\AppData\Local\act\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.23.6 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.75 -X main.commit=bd97dc8d9422a8b04e6193c6c86afa8a7a693fdf -X main.date=2025-03-01T02:31:09Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: windows GOAMD64: v1 vcs: git vcs.revision: bd97dc8d9422a8b04e6193c6c86afa8a7a693fdf vcs.time: 2025-03-01T02:30:53Z vcs.modified: false Docker Engine: Engine version: 28.0.1 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.15.153.1-microsoft-standard-WSL2 OS CPU: 16 OS memory: 15946 MB Security options: name=seccomp,profile=unconfined ``` ### Command used with act ```sh act -W .\.github\workflows\test-workflow.yaml ``` ### Describe issue I've found a bug, where you can use a composite action's output variable with the wrong name in act, whereas on github actions' runner it won't be picked up. In this stripped down code, I have a workflow, called `test-workflow`, that calls the composite action `composite-action`. The composite action outputs a value, `dummy_variable`, from the step `dummy_step` own outputted variable that is called `value`. The workflow calls the composite action in `composite_step`, then outputs the `dumy_variable` with the path `steps.composite_step.outputs.value`: ```sh [Test workflow/test] ⭐ Run Main Launch composite action [Test workflow/test] ⚙ ::set-output:: dummy_variable=dummy_variable [Test workflow/test] ✅ Success - Main Launch composite action [Test workflow/test] ⚙ ::set-output:: value=dummy_variable [Test workflow/test] ⭐ Run Main echo output dummy_variable [Test workflow/test] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= | output dummy_variable [Test workflow/test] ✅ Success - Main echo output dummy_variable ``` Because the path is wrong, on github actions' runner, the variable isn't picked up and outputs `output`, without `dummy_variable`: ```sh 2025-03-17T18:07:29.2844255Z ##[group]Run ./.github/actions/composite-action 2025-03-17T18:07:29.2845519Z ##[endgroup] 2025-03-17T18:07:29.2958551Z ##[group]Run echo "value=dummy_variable" >> $GITHUB_OUTPUT 2025-03-17T18:07:29.2960196Z echo "value=dummy_variable" >> $GITHUB_OUTPUT 2025-03-17T18:07:29.3015023Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} 2025-03-17T18:07:29.3016468Z ##[endgroup] 2025-03-17T18:07:29.3265871Z ##[group]Run echo output 2025-03-17T18:07:29.3266858Z echo output  2025-03-17T18:07:29.3318319Z shell: /usr/bin/bash -e {0} 2025-03-17T18:07:29.3319284Z ##[endgroup] 2025-03-17T18:07:29.3400444Z output ``` Fixing the path from `outputs.value` to `outputst.dummy_variable`, such as: ```sh - run: echo output ${{ steps.composite_step.outputs.dummy_variable }} ``` Doesn't change anything in act: ```sh [Test workflow/test] ⭐ Run Main Launch composite action [Test workflow/test] ⭐ Run Main echo "value=dummy_variable" >> $GITHUB_OUTPUT [Test workflow/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/composite_step-composite-dummy_step.sh] user= workdir= [Test workflow/test] ✅ Success - Main echo "value=dummy_variable" >> $GITHUB_OUTPUT [Test workflow/test] ⚙ ::set-output:: value=dummy_variable [Test workflow/test] ⚙ ::set-output:: dummy_variable=dummy_variable [Test workflow/test] ✅ Success - Main Launch composite action [Test workflow/test] ⚙ ::set-output:: value=dummy_variable [Test workflow/test] ⭐ Run Main echo output dummy_variable [Test workflow/test] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/2] user= workdir= | output dummy_variable [Test workflow/test] ✅ Success - Main echo output dummy_variable ``` And fixes it on github actions' runner ```sh 2025-03-17T18:15:00.7710134Z ##[group]Run ./.github/actions/composite-action 2025-03-17T18:15:00.7710702Z ##[endgroup] 2025-03-17T18:15:00.7809083Z ##[group]Run echo "value=dummy_variable" >> $GITHUB_OUTPUT 2025-03-17T18:15:00.7809926Z echo "value=dummy_variable" >> $GITHUB_OUTPUT 2025-03-17T18:15:00.7863255Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} 2025-03-17T18:15:00.7863966Z ##[endgroup] 2025-03-17T18:15:00.8084564Z ##[group]Run echo output dummy_variable 2025-03-17T18:15:00.8085187Z echo output dummy_variable 2025-03-17T18:15:00.8134300Z shell: /usr/bin/bash -e {0} 2025-03-17T18:15:00.8134790Z ##[endgroup] 2025-03-17T18:15:00.8208227Z output dummy_variable ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml # Test workflow name: Test workflow on: push: branches: - "main" jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Launch composite action id: composite_step uses: ./.github/actions/composite-action - run: echo output ${{ steps.composite_step.outputs.value }} # Composite action name: Composite action description: Composite action outputs: dummy_variable: description: Dummy variable value: ${{ steps.dummy_step.outputs.value }} runs: using: composite steps: - id: dummy_step shell: bash run: echo "value=dummy_variable" >> $GITHUB_OUTPUT ``` ### Relevant log output ```sh Because there were multiple logs, they are included in the Describe issue paragraph ``` ### Additional information _No response_
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#1216
No description provided.