[GH-ISSUE #839] Issue: dockerfile action is not able to set output variables #509

Closed
opened 2026-03-01 21:44:03 +03:00 by kerem · 2 comments
Owner

Originally created by @josecelano on GitHub (Oct 11, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/839

I do not have the value of an output var from a previous step.
The action that generates the output var is a docker action. I can't use the next step.
It's working fine on the GitHub runner.

I've created a sample repo to reproduce the error: https://github.com/josecelano/act-output-bug

System information

  • Operating System: Linux
  • Architecture: x86_64
  • Apple M1: no
  • Docker version: 20.10.9, build c2ea9bc
  • Docker image used in act: catthehacker/ubuntu:act-latest
  • act version: 0.2.24

Expected behaviour

I would expect the same output as on GitHub runner: https://github.com/josecelano/act-output-bug/actions/workflows/act-bug-workflow.yml

I expect the variable to be available in the next step (same job).

Actual behaviour

The output variable is empty.

Workflow and/or repository

Workflow: https://github.com/josecelano/act-output-bug
Repo: https://github.com/josecelano/act-output-bug

name: act bug workflow

on:
  pull_request:
    branches: [ main ]
  push:
    branches: [ main ]    

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0 # To fetch all history for all branches and tags. Needed for git diff.

      - id: set_1
        run: |
          echo "::set-output name=var_1::$(echo hello)"

      - id: set_2
        run: |
          echo "::set-output name=var_2::$(echo world)"

      - name: set_3
        id: set_3
        uses: ./.github/actions/sample-action

      - name: print
        run: |
          echo "The diff output is: ${{ steps.set_1.outputs.var_1 }}"
          echo "The diff output is: ${{ steps.set_2.outputs.var_2 }}"
          echo "The diff output is: ${{ steps.set_3.outputs.var_3 }}"

Steps to reproduce

git clone git@github.com:josecelano/act-output-bug.git
cd act-output-bug
act pull_request -j build

act output

Log
[act bug workflow/build] 🚀  Start image=catthehacker/ubuntu:act-latest
[act bug workflow/build]   🐳  docker pull catthehacker/ubuntu:act-latest
[act bug workflow/build]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[act bug workflow/build] Created container name=act-act-bug-workflow-build id=d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b from image catthehacker/ubuntu:act-latest (platform: )
[act bug workflow/build] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[act bug workflow/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[act bug workflow/build] Starting container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b
[act bug workflow/build] Started container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b
[act bug workflow/build]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[act bug workflow/build] Exec command '[mkdir -m 0777 -p /var/run/act]'
[act bug workflow/build]   🐳  docker cp src=/home/josecelano/Documents/github/josecelano/act-output-bug/. dst=/home/josecelano/Documents/github/josecelano/act-output-bug
[act bug workflow/build]   🐳  docker exec cmd=[mkdir -p /home/josecelano/Documents/github/josecelano/act-output-bug] user=
[act bug workflow/build] Exec command '[mkdir -p /home/josecelano/Documents/github/josecelano/act-output-bug]'
[act bug workflow/build] Extracting content from '/tmp/act269730700' to '/home/josecelano/Documents/github/josecelano/act-output-bug'
[act bug workflow/build] Extracting content to '/var/run/act/'
[act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 INPUT_FETCH-DEPTH:0 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[act bug workflow/build] ⭐  Run actions/checkout@v2
[act bug workflow/build] Skipping local actions/checkout because workdir was already copied
[act bug workflow/build]   ✅  Success - actions/checkout@v2
[act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_1 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[act bug workflow/build] ⭐  Run echo "::set-output name=var_1::$(echo hello)"
[act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug'
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_1] user=
[act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_1]'
[act bug workflow/build]   ⚙  ::set-output:: var_1=hello
[act bug workflow/build]   ✅  Success - echo "::set-output name=var_1::$(echo hello)"
[act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_2 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[act bug workflow/build] ⭐  Run echo "::set-output name=var_2::$(echo world)"
[act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug'
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_2] user=
[act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_2]'
[act bug workflow/build]   ⚙  ::set-output:: var_2=world
[act bug workflow/build]   ✅  Success - echo "::set-output name=var_2::$(echo world)"
[act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_3 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[act bug workflow/build] ⭐  Run set_3
[act bug workflow/build]   🐳  docker pull act-github-actions-sample-action:latest
[act bug workflow/build]   🐳  docker create image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[]
[act bug workflow/build] Created container name=act-act-bug-wo-set-3 id=ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab from image act-github-actions-sample-action:latest (platform: )
[act bug workflow/build] ENV ==> [RUNNER_TRACKING_ID= ACT=true GITHUB_ENV=/var/run/act/workflow/envs.txt RUNNER_USER=root GITHUB_REF=refs/heads/main GITHUB_ACTION=set_3 GITHUB_WORKSPACE=/home/josecelano/Documents/github/josecelano/act-output-bug GITHUB_RUN_ID=1 DEPLOYMENT_BASEPATH=/opt/runner GITHUB_SHA=2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_REPOSITORY_OWNER=josecelano GITHUB_GRAPHQL_URL=https://api.github.com/graphql GITHUB_EVENT_NAME=pull_request IMAGE_OS=ubuntu20 GITHUB_EVENT_PATH=/var/run/act/workflow/event.json GITHUB_PATH=/var/run/act/workflow/paths.txt GITHUB_API_URL=https://api.github.com GITHUB_SERVER_URL=https://github.com GITHUB_RETENTION_DAYS=0 RUN_TOOL_CACHE=/opt/hostedtoolcache GITHUB_BASE_REF= GITHUB_ACTOR=nektos/act GITHUB_REPOSITORY=josecelano/act-output-bug GITHUB_TOKEN= GITHUB_ACTION_REF= GITHUB_HEAD_REF= RUNNER_PERFLOG=/dev/null ImageOS=ubuntu20 GITHUB_ACTION_REPOSITORY= GITHUB_JOB=build GITHUB_WORKFLOW=act bug workflow PATH=/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache USER=root GITHUB_ACTIONS=true GITHUB_RUN_NUMBER=1 LSB_OS_VERSION=2004 LSB_RELEASE=20.04 CI=true RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[act bug workflow/build]   🐳  docker run image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[]
[act bug workflow/build] Starting container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab
[act bug workflow/build]   ⚙  ::set-output:: var3=1234
[act bug workflow/build]   | var3: 1234
[act bug workflow/build] Started container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab
[act bug workflow/build] Return status: 0
[act bug workflow/build] Removed container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab
[act bug workflow/build]   ✅  Success - set_3
[act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:4 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[act bug workflow/build] ⭐  Run print
[act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug'
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/4] user=
[act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/4]'
[act bug workflow/build]   | The diff output is: hello
[act bug workflow/build]   | The diff output is: world
[act bug workflow/build]   | The diff output is: 
[act bug workflow/build]   ✅  Success - print
[act bug workflow/build] Removed container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b
[act bug workflow/build]   🐳  docker volume rm act-act-bug-workflow-build
Originally created by @josecelano on GitHub (Oct 11, 2021). Original GitHub issue: https://github.com/nektos/act/issues/839 I do not have the value of an output var from a previous step. The action that generates the output var is a docker action. I can't use the next step. It's working fine on the GitHub runner. I've created a sample repo to reproduce the error: https://github.com/josecelano/act-output-bug ## System information - Operating System: Linux - Architecture: x86_64 - Apple M1: no - Docker version: 20.10.9, build c2ea9bc - Docker image used in `act`: catthehacker/ubuntu:act-latest - `act` version: 0.2.24 ## Expected behaviour I would expect the same output as on GitHub runner: https://github.com/josecelano/act-output-bug/actions/workflows/act-bug-workflow.yml I expect the variable to be available in the next step (same job). ## Actual behaviour The output variable is empty. ## Workflow and/or repository Workflow: https://github.com/josecelano/act-output-bug Repo: https://github.com/josecelano/act-output-bug ``` name: act bug workflow on: pull_request: branches: [ main ] push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # To fetch all history for all branches and tags. Needed for git diff. - id: set_1 run: | echo "::set-output name=var_1::$(echo hello)" - id: set_2 run: | echo "::set-output name=var_2::$(echo world)" - name: set_3 id: set_3 uses: ./.github/actions/sample-action - name: print run: | echo "The diff output is: ${{ steps.set_1.outputs.var_1 }}" echo "The diff output is: ${{ steps.set_2.outputs.var_2 }}" echo "The diff output is: ${{ steps.set_3.outputs.var_3 }}" ``` ## Steps to reproduce ``` git clone git@github.com:josecelano/act-output-bug.git cd act-output-bug act pull_request -j build ``` ## `act` output <details> <summary>Log</summary> ```none [act bug workflow/build] 🚀 Start image=catthehacker/ubuntu:act-latest [act bug workflow/build] 🐳 docker pull catthehacker/ubuntu:act-latest [act bug workflow/build] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [act bug workflow/build] Created container name=act-act-bug-workflow-build id=d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b from image catthehacker/ubuntu:act-latest (platform: ) [act bug workflow/build] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [act bug workflow/build] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [act bug workflow/build] Starting container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b [act bug workflow/build] Started container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b [act bug workflow/build] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [act bug workflow/build] Exec command '[mkdir -m 0777 -p /var/run/act]' [act bug workflow/build] 🐳 docker cp src=/home/josecelano/Documents/github/josecelano/act-output-bug/. dst=/home/josecelano/Documents/github/josecelano/act-output-bug [act bug workflow/build] 🐳 docker exec cmd=[mkdir -p /home/josecelano/Documents/github/josecelano/act-output-bug] user= [act bug workflow/build] Exec command '[mkdir -p /home/josecelano/Documents/github/josecelano/act-output-bug]' [act bug workflow/build] Extracting content from '/tmp/act269730700' to '/home/josecelano/Documents/github/josecelano/act-output-bug' [act bug workflow/build] Extracting content to '/var/run/act/' [act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 INPUT_FETCH-DEPTH:0 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root] [act bug workflow/build] ⭐ Run actions/checkout@v2 [act bug workflow/build] Skipping local actions/checkout because workdir was already copied [act bug workflow/build] ✅ Success - actions/checkout@v2 [act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_1 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root] [act bug workflow/build] ⭐ Run echo "::set-output name=var_1::$(echo hello)" [act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug' [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_1] user= [act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_1]' [act bug workflow/build] ⚙ ::set-output:: var_1=hello [act bug workflow/build] ✅ Success - echo "::set-output name=var_1::$(echo hello)" [act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_2 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root] [act bug workflow/build] ⭐ Run echo "::set-output name=var_2::$(echo world)" [act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug' [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_2] user= [act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/set_2]' [act bug workflow/build] ⚙ ::set-output:: var_2=world [act bug workflow/build] ✅ Success - echo "::set-output name=var_2::$(echo world)" [act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set_3 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root] [act bug workflow/build] ⭐ Run set_3 [act bug workflow/build] 🐳 docker pull act-github-actions-sample-action:latest [act bug workflow/build] 🐳 docker create image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[] [act bug workflow/build] Created container name=act-act-bug-wo-set-3 id=ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab from image act-github-actions-sample-action:latest (platform: ) [act bug workflow/build] ENV ==> [RUNNER_TRACKING_ID= ACT=true GITHUB_ENV=/var/run/act/workflow/envs.txt RUNNER_USER=root GITHUB_REF=refs/heads/main GITHUB_ACTION=set_3 GITHUB_WORKSPACE=/home/josecelano/Documents/github/josecelano/act-output-bug GITHUB_RUN_ID=1 DEPLOYMENT_BASEPATH=/opt/runner GITHUB_SHA=2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_REPOSITORY_OWNER=josecelano GITHUB_GRAPHQL_URL=https://api.github.com/graphql GITHUB_EVENT_NAME=pull_request IMAGE_OS=ubuntu20 GITHUB_EVENT_PATH=/var/run/act/workflow/event.json GITHUB_PATH=/var/run/act/workflow/paths.txt GITHUB_API_URL=https://api.github.com GITHUB_SERVER_URL=https://github.com GITHUB_RETENTION_DAYS=0 RUN_TOOL_CACHE=/opt/hostedtoolcache GITHUB_BASE_REF= GITHUB_ACTOR=nektos/act GITHUB_REPOSITORY=josecelano/act-output-bug GITHUB_TOKEN= GITHUB_ACTION_REF= GITHUB_HEAD_REF= RUNNER_PERFLOG=/dev/null ImageOS=ubuntu20 GITHUB_ACTION_REPOSITORY= GITHUB_JOB=build GITHUB_WORKFLOW=act bug workflow PATH=/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache USER=root GITHUB_ACTIONS=true GITHUB_RUN_NUMBER=1 LSB_OS_VERSION=2004 LSB_RELEASE=20.04 CI=true RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [act bug workflow/build] 🐳 docker run image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[] [act bug workflow/build] Starting container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab [act bug workflow/build] ⚙ ::set-output:: var3=1234 [act bug workflow/build] | var3: 1234 [act bug workflow/build] Started container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab [act bug workflow/build] Return status: 0 [act bug workflow/build] Removed container: ae112a2f706f9292603b31f3b1b8c3852bf70df088923261a550cf963f813eab [act bug workflow/build] ✅ Success - set_3 [act bug workflow/build] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:4 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:build GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:josecelano/act-output-bug GITHUB_REPOSITORY_OWNER:josecelano GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:2657aba5febc16aac0a8854f8f187c699a7b669d GITHUB_TOKEN: GITHUB_WORKFLOW:act bug workflow GITHUB_WORKSPACE:/home/josecelano/Documents/github/josecelano/act-output-bug IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root] [act bug workflow/build] ⭐ Run print [act bug workflow/build] Extracting content to '/home/josecelano/Documents/github/josecelano/act-output-bug' [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/4] user= [act bug workflow/build] Exec command '[bash --noprofile --norc -e -o pipefail /home/josecelano/Documents/github/josecelano/act-output-bug/workflow/4]' [act bug workflow/build] | The diff output is: hello [act bug workflow/build] | The diff output is: world [act bug workflow/build] | The diff output is: [act bug workflow/build] ✅ Success - print [act bug workflow/build] Removed container: d7c192f854b81371f3942b72850b3a0759b6ba8e5c353b5615ffcfa69319333b [act bug workflow/build] 🐳 docker volume rm act-act-bug-workflow-build ``` </details>
kerem 2026-03-01 21:44:03 +03:00
Author
Owner

@ChristopherHX commented on GitHub (Oct 11, 2021):

Interesting,

⚙ ::set-output:: var3=1234

This line indicates the output is interpreted correctly (https://github.com/nektos/act/blob/master/pkg/runner/command.go#L47) by act as command, this issue seems to be more complex.
This feature is implemented in act, however act refuses to rebuild an existing docker action image. So if you make changes to your dockerfile, act still uses the first one build unless you delete it with docker image rm .....

It does work with act-0.2.24-windows-x86_64 (also on master) on my machine (different docker image: node:12.20.1-buster-slim) after editing the entrypoint of your action to ENTRYPOINT ["sh", "/entrypoint.sh"], because act on windows seems to drop the exec permission of your entrypoint.sh

Log

This log indicates there is a different issue in windows \mnt\c\Users\Christopher\act-output-bug doesn't use the correct slash, while it doesn't impact the run.

act.exe pull_request -j build
[act bug workflow/build] 🚀  Start image=node:12.20.1-buster-slim
[act bug workflow/build]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[act bug workflow/build]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[act bug workflow/build]   🐳  docker cp src=C:\Users\Christopher\act-output-bug\. dst=\mnt\c\Users\Christopher\act-output-bug
[act bug workflow/build]   🐳  docker exec cmd=[mkdir -p \mnt\c\Users\Christopher\act-output-bug] user=
[act bug workflow/build] ⭐  Run actions/checkout@v2
[act bug workflow/build]   ✅  Success - actions/checkout@v2
[act bug workflow/build] ⭐  Run echo "::set-output name=var_1::$(echo hello)"
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/set_1] user=
[act bug workflow/build]   ⚙  ::set-output:: var_1=hello
[act bug workflow/build]   ✅  Success - echo "::set-output name=var_1::$(echo hello)"
[act bug workflow/build] ⭐  Run echo "::set-output name=var_2::$(echo world)"
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/set_2] user=
[act bug workflow/build]   ⚙  ::set-output:: var_2=world
[act bug workflow/build]   ✅  Success - echo "::set-output name=var_2::$(echo world)"
[act bug workflow/build] ⭐  Run set_3
[act bug workflow/build]   🐳  docker build -t act-github-actions-sample-action:latest --platform  \mnt\c\Users\Christopher\act-output-bug\.github\actions\sample-action
[act bug workflow/build]   🐳  docker run image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[]
[act bug workflow/build]   ⚙  ::set-output:: var_3=1234
| var_3: 1234
[act bug workflow/build]   ✅  Success - set_3
[act bug workflow/build] ⭐  Run print
[act bug workflow/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/4] user=
| The diff output is: hello
| The diff output is: world
| The diff output is: 1234
[act bug workflow/build]   ✅  Success - print
<!-- gh-comment-id:940457615 --> @ChristopherHX commented on GitHub (Oct 11, 2021): Interesting, > ⚙ ::set-output:: var3=1234 This line indicates the output is interpreted correctly (https://github.com/nektos/act/blob/master/pkg/runner/command.go#L47) by act as command, this issue seems to be more complex. This feature is implemented in act, however act refuses to rebuild an existing docker action image. So if you make changes to your dockerfile, act still uses the first one build unless you delete it with `docker image rm ....`. It does work with act-0.2.24-windows-x86_64 (also on master) on my machine (different docker image: `node:12.20.1-buster-slim`) after editing the entrypoint of your action to `ENTRYPOINT ["sh", "/entrypoint.sh"]`, because act on windows seems to drop the exec permission of your entrypoint.sh <details> <summary>Log</summary> This log indicates there is a different issue in windows `\mnt\c\Users\Christopher\act-output-bug` doesn't use the correct slash, while it doesn't impact the run. ``` act.exe pull_request -j build [act bug workflow/build] 🚀 Start image=node:12.20.1-buster-slim [act bug workflow/build] 🐳 docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [act bug workflow/build] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [act bug workflow/build] 🐳 docker cp src=C:\Users\Christopher\act-output-bug\. dst=\mnt\c\Users\Christopher\act-output-bug [act bug workflow/build] 🐳 docker exec cmd=[mkdir -p \mnt\c\Users\Christopher\act-output-bug] user= [act bug workflow/build] ⭐ Run actions/checkout@v2 [act bug workflow/build] ✅ Success - actions/checkout@v2 [act bug workflow/build] ⭐ Run echo "::set-output name=var_1::$(echo hello)" [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/set_1] user= [act bug workflow/build] ⚙ ::set-output:: var_1=hello [act bug workflow/build] ✅ Success - echo "::set-output name=var_1::$(echo hello)" [act bug workflow/build] ⭐ Run echo "::set-output name=var_2::$(echo world)" [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/set_2] user= [act bug workflow/build] ⚙ ::set-output:: var_2=world [act bug workflow/build] ✅ Success - echo "::set-output name=var_2::$(echo world)" [act bug workflow/build] ⭐ Run set_3 [act bug workflow/build] 🐳 docker build -t act-github-actions-sample-action:latest --platform \mnt\c\Users\Christopher\act-output-bug\.github\actions\sample-action [act bug workflow/build] 🐳 docker run image=act-github-actions-sample-action:latest platform= entrypoint=[] cmd=[] [act bug workflow/build] ⚙ ::set-output:: var_3=1234 | var_3: 1234 [act bug workflow/build] ✅ Success - set_3 [act bug workflow/build] ⭐ Run print [act bug workflow/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /mnt/c/Users/Christopher/act-output-bug/workflow/4] user= | The diff output is: hello | The diff output is: world | The diff output is: 1234 [act bug workflow/build] ✅ Success - print ``` </details>
Author
Owner

@github-actions[bot] commented on GitHub (Nov 11, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:965859516 --> @github-actions[bot] commented on GitHub (Nov 11, 2021): Issue is stale and will be closed in 14 days unless there is new activity
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#509
No description provided.