[GH-ISSUE #1218] The env variables for step are not populated #672

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

Originally created by @dmikov on GitHub (Jun 15, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1218

Bug report info

act version:            0.2.26
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 32
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/dmikov/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
                -P self-hosted=nektos/act-environments-ubuntu:18.04
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu 20.04.4 LTS
        OS type:               linux
        OS version:            20.04
        OS arch:               x86_64
        OS kernel:             5.13.0-48-generic
        OS CPU:                32
        OS memory:             32071 MB
        Security options:
                name=apparmor
                name=seccomp,profile=default

Command used with act

act workflow_dispatch -W .github/workflows/nektos-act-bug.yml

Describe issue

When running workflows on ACT the variables defined in the env portion of the step are not populated, the env portions of workflow and job seems to be working just fine. Below is the workflow and here is the outputs. First one from ACT and second one from GitHub

image

image

You can see that on ACT step-variable is missing.

No response

Workflow content

name: Nektos Act Bug Env

on:
  workflow_dispatch:

env:
  WORKFLOW_LEVEL: workflow-level-variable

jobs:
  read-all:
    runs-on: ubuntu-latest
    env:
      JOB_LEVEL: job-level-variable
    steps:
      - name: read variables
        env:
          STEP_LEVEL: step-level-variable
        run: |
              echo "${{ env.WORKFLOW_LEVEL }}"
              echo "${{ env.JOB_LEVEL }}"
              echo "${{ env.STEP_LEVEL }}"

Relevant log output

dmikov@ubuntu:~/source/github-workflows-example-act$ act workflow_dispatch -W .github/workflows/nektos-act-bug.yml -v
DEBU[0000] Loading environment from /home/dmikov/source/github-workflows-example-act/.env 
DEBU[0000] Loading secrets from /home/dmikov/source/github-workflows-example-act/.secrets 
DEBU[0000] Loading workflow '/home/dmikov/source/github-workflows-example-act/.github/workflows/nektos-act-bug.yml' 
DEBU[0000] Reading workflow '/home/dmikov/source/github-workflows-example-act/.github/workflows/nektos-act-bug.yml' 
DEBU[0000] Planning event: workflow_dispatch            
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] evaluating expression 'success()'            
DEBU[0000] expression 'success()' evaluated to 'true'   
[Nektos Act Bug Env/read-all] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
[Nektos Act Bug Env/read-all]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Nektos Act Bug Env/read-all]   🐳  docker pull ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0000] Image exists? true                           
[Nektos Act Bug Env/read-all]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all] Created container name=act-Nektos-Act-Bug-Env-read-all id=495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799 from image ghcr.io/catthehacker/ubuntu:act-latest (platform: )
[Nektos Act Bug Env/read-all] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Nektos Act Bug Env/read-all]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all] Starting container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799
[Nektos Act Bug Env/read-all] Started container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Nektos Act Bug Env/read-all] Exec command '[mkdir -m 0777 -p /var/run/act]'
[Nektos Act Bug Env/read-all] Working directory '/home/dmikov/source/github-workflows-example-act'
DEBU[0000] Writing entry to tarball workflow/event.json len:2 
DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 
DEBU[0000] Writing entry to tarball workflow/paths.txt len:0 
[Nektos Act Bug Env/read-all] Extracting content to '/var/run/act/'
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] evaluating expression ''                     
DEBU[0000] expression '' evaluated to 'true'            
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
[Nektos Act Bug Env/read-all] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: 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:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:read-all GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:dmikov/github-workflows-example-act GITHUB_REPOSITORY_OWNER:dmikov GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea GITHUB_TOKEN: GITHUB_WORKFLOW:Nektos Act Bug Env GITHUB_WORKSPACE:/home/dmikov/source/github-workflows-example-act IMAGE_OS:ubuntu20 ImageOS:ubuntu20 JOB_LEVEL:job-level-variable LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/16.15.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache STEP_LEVEL:step-level-variable USER:root WORKFLOW_LEVEL:workflow-level-variable]
[Nektos Act Bug Env/read-all] ⭐  Run read variables
DEBU[0000] expression 'echo "${{ env.WORKFLOW_LEVEL }}"
echo "${{ env.JOB_LEVEL }}"
echo "${{ env.STEP_LEVEL }}"
' rewritten to 'format('echo "{0}"
echo "{1}"
echo "{2}"
', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' 
DEBU[0000] evaluating expression 'format('echo "{0}"
echo "{1}"
echo "{2}"
', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' 
DEBU[0000] expression 'format('echo "{0}"
echo "{1}"
echo "{2}"
', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' evaluated to '%!t(string=echo "workflow-level-variable"
echo "job-level-variable"
echo ""
)' 
DEBU[0000] Wrote command 

echo "workflow-level-variable"
echo "job-level-variable"
echo ""


 to 'workflow/0' 
DEBU[0000] Writing entry to tarball workflow/0 len:67   
[Nektos Act Bug Env/read-all] Extracting content to '/var/run/act'
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Nektos Act Bug Env/read-all] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0]'
[Nektos Act Bug Env/read-all] Working directory '/home/dmikov/source/github-workflows-example-act'
| workflow-level-variable
| job-level-variable
| 
[Nektos Act Bug Env/read-all]   ✅  Success - read variables
[Nektos Act Bug Env/read-all] Removed container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799
[Nektos Act Bug Env/read-all]   🐳  docker volume rm act-Nektos-Act-Bug-Env-read-all
DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' 
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea 
dmikov@ubuntu:~/source/github-workflows-example-act$

Additional information

No response

Originally created by @dmikov on GitHub (Jun 15, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1218 ### Bug report info ```plain text act version: 0.2.26 GOOS: linux GOARCH: amd64 NumCPU: 32 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/dmikov/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 -P self-hosted=nektos/act-environments-ubuntu:18.04 Docker Engine: Engine version: 20.10.17 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 20.04.4 LTS OS type: linux OS version: 20.04 OS arch: x86_64 OS kernel: 5.13.0-48-generic OS CPU: 32 OS memory: 32071 MB Security options: name=apparmor name=seccomp,profile=default ``` ### Command used with act ```sh act workflow_dispatch -W .github/workflows/nektos-act-bug.yml ``` ### Describe issue When running workflows on ACT the variables defined in the `env` portion of the step are not populated, the `env` portions of workflow and job seems to be working just fine. Below is the workflow and here is the outputs. First one from ACT and second one from GitHub ![image](https://user-images.githubusercontent.com/5971459/173721080-bd58e1cf-ef27-4945-9642-6ff49117ea98.png) ![image](https://user-images.githubusercontent.com/5971459/173721158-97d112e0-c5c3-4daa-9048-1eef7915163a.png) You can see that on ACT step-variable is missing. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Nektos Act Bug Env on: workflow_dispatch: env: WORKFLOW_LEVEL: workflow-level-variable jobs: read-all: runs-on: ubuntu-latest env: JOB_LEVEL: job-level-variable steps: - name: read variables env: STEP_LEVEL: step-level-variable run: | echo "${{ env.WORKFLOW_LEVEL }}" echo "${{ env.JOB_LEVEL }}" echo "${{ env.STEP_LEVEL }}" ``` ### Relevant log output ```sh dmikov@ubuntu:~/source/github-workflows-example-act$ act workflow_dispatch -W .github/workflows/nektos-act-bug.yml -v DEBU[0000] Loading environment from /home/dmikov/source/github-workflows-example-act/.env DEBU[0000] Loading secrets from /home/dmikov/source/github-workflows-example-act/.secrets DEBU[0000] Loading workflow '/home/dmikov/source/github-workflows-example-act/.github/workflows/nektos-act-bug.yml' DEBU[0000] Reading workflow '/home/dmikov/source/github-workflows-example-act/.github/workflows/nektos-act-bug.yml' DEBU[0000] Planning event: workflow_dispatch DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] evaluating expression 'success()' DEBU[0000] expression 'success()' evaluated to 'true' [Nektos Act Bug Env/read-all] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea [Nektos Act Bug Env/read-all] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false [Nektos Act Bug Env/read-all] 🐳 docker pull ghcr.io/catthehacker/ubuntu:act-latest DEBU[0000] Image exists? true [Nektos Act Bug Env/read-all] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] Created container name=act-Nektos-Act-Bug-Env-read-all id=495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799 from image ghcr.io/catthehacker/ubuntu:act-latest (platform: ) [Nektos Act Bug Env/read-all] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Nektos Act Bug Env/read-all] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] Starting container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799 [Nektos Act Bug Env/read-all] Started container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799 [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [Nektos Act Bug Env/read-all] Exec command '[mkdir -m 0777 -p /var/run/act]' [Nektos Act Bug Env/read-all] Working directory '/home/dmikov/source/github-workflows-example-act' DEBU[0000] Writing entry to tarball workflow/event.json len:2 DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 DEBU[0000] Writing entry to tarball workflow/paths.txt len:0 [Nektos Act Bug Env/read-all] Extracting content to '/var/run/act/' DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] evaluating expression '' DEBU[0000] expression '' evaluated to 'true' DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea [Nektos Act Bug Env/read-all] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: 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:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:read-all GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:dmikov/github-workflows-example-act GITHUB_REPOSITORY_OWNER:dmikov GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea GITHUB_TOKEN: GITHUB_WORKFLOW:Nektos Act Bug Env GITHUB_WORKSPACE:/home/dmikov/source/github-workflows-example-act IMAGE_OS:ubuntu20 ImageOS:ubuntu20 JOB_LEVEL:job-level-variable LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/16.15.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache STEP_LEVEL:step-level-variable USER:root WORKFLOW_LEVEL:workflow-level-variable] [Nektos Act Bug Env/read-all] ⭐ Run read variables DEBU[0000] expression 'echo "${{ env.WORKFLOW_LEVEL }}" echo "${{ env.JOB_LEVEL }}" echo "${{ env.STEP_LEVEL }}" ' rewritten to 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' DEBU[0000] evaluating expression 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' DEBU[0000] expression 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' evaluated to '%!t(string=echo "workflow-level-variable" echo "job-level-variable" echo "" )' DEBU[0000] Wrote command echo "workflow-level-variable" echo "job-level-variable" echo "" to 'workflow/0' DEBU[0000] Writing entry to tarball workflow/0 len:67 [Nektos Act Bug Env/read-all] Extracting content to '/var/run/act' [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= [Nektos Act Bug Env/read-all] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0]' [Nektos Act Bug Env/read-all] Working directory '/home/dmikov/source/github-workflows-example-act' | workflow-level-variable | job-level-variable | [Nektos Act Bug Env/read-all] ✅ Success - read variables [Nektos Act Bug Env/read-all] Removed container: 495cb9f14ce4e70c28f82bea84d2264f3dd3a259051c907e8deab8bb7877e799 [Nektos Act Bug Env/read-all] 🐳 docker volume rm act-Nektos-Act-Bug-Env-read-all DEBU[0000] Loading slug from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Loading revision from git directory '/home/dmikov/source/github-workflows-example-act/.git' DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea DEBU[0000] HEAD points to '7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea' DEBU[0000] using github ref: refs/heads/main DEBU[0000] Found revision: 7f68f0e000d58e71a6aa7d7d0316bb2d3c9a77ea dmikov@ubuntu:~/source/github-workflows-example-act$ ``` ### Additional information _No response_
Author
Owner

@github-actions[bot] commented on GitHub (Jul 16, 2022):

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

<!-- gh-comment-id:1186033367 --> @github-actions[bot] commented on GitHub (Jul 16, 2022): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@alex-savchuk commented on GitHub (Sep 8, 2022):

Cant reproduce with master - all vars are shown:
[Nektos Act Bug Env/read-all] [DEBUG] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: 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:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:read-all GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/step-env-support GITHUB_REF_NAME:step-env-support GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:alex-savchuk/act GITHUB_REPOSITORY_OWNER:alex-savchuk GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:b514649c3da64a1be92b8e22b50e296a07d759f6 GITHUB_TOKEN: GITHUB_WORKFLOW:Nektos Act Bug Env GITHUB_WORKSPACE:/mnt/d/Sources/act IMAGE_OS:ubuntu20 ImageOS:ubuntu20 JOB_LEVEL:job-level-variable LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/16.17.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache STEP_LEVEL:step-level-variable USER:root WORKFLOW_LEVEL:workflow-level-variable]
[Nektos Act Bug Env/read-all] [DEBUG] expression 'echo "${{ env.WORKFLOW_LEVEL }}" echo "${{ env.JOB_LEVEL }}" echo "${{ env.STEP_LEVEL }}" ' rewritten to 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)'
[Nektos Act Bug Env/read-all] [DEBUG] expression 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' evaluated to '%!t(string=echo "workflow-level-variable" echo "job-level-variable" echo "step-level-variable" )'
So, maybe it's fixed or my env somehow affect it.

P.S. in provided log I see that env vars are set:
[Nektos Act Bug Env/read-all] setupEnv => map[... JOB_LEVEL:job-level-variable ... STEP_LEVEL:step-level-variable ... WORKFLOW_LEVEL:workflow-level-variable]
but step's one is not applied during run evaluating.

<!-- gh-comment-id:1240109429 --> @alex-savchuk commented on GitHub (Sep 8, 2022): Cant reproduce with master - all vars are shown: `[Nektos Act Bug Env/read-all] [DEBUG] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: 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:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:read-all GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/step-env-support GITHUB_REF_NAME:step-env-support GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:alex-savchuk/act GITHUB_REPOSITORY_OWNER:alex-savchuk GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:b514649c3da64a1be92b8e22b50e296a07d759f6 GITHUB_TOKEN: GITHUB_WORKFLOW:Nektos Act Bug Env GITHUB_WORKSPACE:/mnt/d/Sources/act IMAGE_OS:ubuntu20 ImageOS:ubuntu20 JOB_LEVEL:job-level-variable LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/16.17.0/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache STEP_LEVEL:step-level-variable USER:root WORKFLOW_LEVEL:workflow-level-variable] ` `[Nektos Act Bug Env/read-all] [DEBUG] expression 'echo "${{ env.WORKFLOW_LEVEL }}" echo "${{ env.JOB_LEVEL }}" echo "${{ env.STEP_LEVEL }}" ' rewritten to 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' ` ` [Nektos Act Bug Env/read-all] [DEBUG] expression 'format('echo "{0}" echo "{1}" echo "{2}" ', env.WORKFLOW_LEVEL, env.JOB_LEVEL, env.STEP_LEVEL)' evaluated to '%!t(string=echo "workflow-level-variable" echo "job-level-variable" echo "step-level-variable" )' ` So, maybe it's fixed or my env somehow affect it. P.S. in provided log I see that env vars are set: `[Nektos Act Bug Env/read-all] setupEnv => map[... JOB_LEVEL:job-level-variable ... STEP_LEVEL:step-level-variable ... WORKFLOW_LEVEL:workflow-level-variable] ` but step's one is not applied during run evaluating.
Author
Owner

@jsoref commented on GitHub (Jul 10, 2023):

Not sure where the problem was, but the fix is somewhere in: https://github.com/nektos/act/releases/tag/v0.2.27

broken in 0.2.26
jsoref@jsoref-mbp tmp.MV7Ekbid % ~/Downloads/act_Darwin_arm64/act --version; ~/Downloads/act_Darwin_arm64/act workflow_dispatch
act version 0.2.26
WARN  ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] 🚀  Start image=catthehacker/ubuntu:act-latest
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Nektos Act Bug Env/read-all]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] ⭐  Run read variables
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| workflow-level-variable
| job-level-variable
|
[Nektos Act Bug Env/read-all]   ✅  Success - read variables
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
fixed in 0.2.27
jsoref@jsoref-mbp tmp.MV7Ekbid % /Users/jsoref/Downloads/act_Darwin_arm64\ \(4\)/act --version ; /Users/jsoref/Downloads/act_Darwin_arm64\ \(4\)/act workflow_dispatch
act version 0.2.27
WARN  ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] 🚀  Start image=catthehacker/ubuntu:act-latest
[Nektos Act Bug Env/read-all]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Nektos Act Bug Env/read-all]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[chown -R 0:0 /var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/tmp.MV7Ekbid] user=0 workdir=
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] ⭐ Run Main read variables
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
[Nektos Act Bug Env/read-all]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| workflow-level-variable
| job-level-variable
| step-level-variable
[Nektos Act Bug Env/read-all]   ✅  Success - Main read variables
[Nektos Act Bug Env/read-all] 🏁  Job succeeded
[Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo
[Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo
jsoref@jsoref-mbp tmp.MV7Ekbid %
<!-- gh-comment-id:1629278160 --> @jsoref commented on GitHub (Jul 10, 2023): Not sure where the problem was, but the fix is somewhere in: https://github.com/nektos/act/releases/tag/v0.2.27 <details><summary>broken in 0.2.26</summary> ``` jsoref@jsoref-mbp tmp.MV7Ekbid % ~/Downloads/act_Darwin_arm64/act --version; ~/Downloads/act_Darwin_arm64/act workflow_dispatch act version 0.2.26 WARN ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠ WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] 🚀 Start image=catthehacker/ubuntu:act-latest WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [Nektos Act Bug Env/read-all] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] ⭐ Run read variables [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | workflow-level-variable | job-level-variable | [Nektos Act Bug Env/read-all] ✅ Success - read variables WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo ``` </details> <details><summary>fixed in 0.2.27</summary> ``` jsoref@jsoref-mbp tmp.MV7Ekbid % /Users/jsoref/Downloads/act_Darwin_arm64\ \(4\)/act --version ; /Users/jsoref/Downloads/act_Darwin_arm64\ \(4\)/act workflow_dispatch act version 0.2.27 WARN ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠ WARN[0000] unable to get git repo: unable to find git repo WARN[0000] unable to get git ref: unable to find git repo WARN[0000] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] 🚀 Start image=catthehacker/ubuntu:act-latest [Nektos Act Bug Env/read-all] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [Nektos Act Bug Env/read-all] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[chown -R 0:0 /var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/tmp.MV7Ekbid] user=0 workdir= [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] ⭐ Run Main read variables [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo [Nektos Act Bug Env/read-all] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | workflow-level-variable | job-level-variable | step-level-variable [Nektos Act Bug Env/read-all] ✅ Success - Main read variables [Nektos Act Bug Env/read-all] 🏁 Job succeeded [Nektos Act Bug Env/read-all] unable to get git repo: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git ref: unable to find git repo [Nektos Act Bug Env/read-all] unable to get git revision: unable to find git repo jsoref@jsoref-mbp tmp.MV7Ekbid % ``` </details>
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#672
No description provided.