[GH-ISSUE #1279] Environment Variables are not set properly #695

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

Originally created by @schmoelder on GitHub (Jul 26, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1279

Bug report info

act version:            0.2.29
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:
        /home/jo/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.3
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.29 -X main.commit=9499612b5818774c5c6d73fbf2596ed464b7b01d -X main.date=2022-07-01T02:54:35Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         9499612b5818774c5c6d73fbf2596ed464b7b01d
                vcs.time:             2022-06-30T02:19:35Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        zfs
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu 22.04 LTS
        OS type:               linux
        OS version:            22.04
        OS arch:               x86_64
        OS kernel:             5.15.0-41-lowlatency
        OS CPU:                8
        OS memory:             15753 MB
        Security options:
                name=apparmor
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act -j test

Describe issue

Environment variables declared in the env section are not set properly. For example, when setting

BUILD_DIR: ${{ github.workspace }}/build

Running

echo "${BUILD_DIR}"

Still outputs the same as running

echo "${{ github.workspace }}"

No response

Workflow content

name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
    defaults:
      run:
        shell: bash -l {0}
    env:
      BUILD_DIR: ${{ github.workspace }}/build
    steps:
      - name: Test
        run: |
          echo "${{ github.workspace }}"
          echo "${BUILD_DIR}"

Relevant log output

[CI/test] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[CI/test]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[CI/test]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/test]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/test]   🐳  docker exec cmd=[chown -R 0:0 /home/jo/software/cadet/CADET] user=0 workdir=
[CI/test] ⭐ Run Main Test
[CI/test]   🐳  docker exec cmd=[bash -l /var/run/act/workflow/0] user= workdir=
| /home/jo/software/cadet/CADET
| /home/jo/software/cadet/CADET
[CI/test]   ✅  Success - Main Test
[CI/test] 🏁  Job succeeded

Additional information

No response

Originally created by @schmoelder on GitHub (Jul 26, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1279 ### Bug report info ```plain text act version: 0.2.29 GOOS: linux GOARCH: amd64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/jo/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.3 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.29 -X main.commit=9499612b5818774c5c6d73fbf2596ed464b7b01d -X main.date=2022-07-01T02:54:35Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 9499612b5818774c5c6d73fbf2596ed464b7b01d vcs.time: 2022-06-30T02:19:35Z vcs.modified: false Docker Engine: Engine version: 20.10.17 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: zfs Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.04 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.15.0-41-lowlatency OS CPU: 8 OS memory: 15753 MB Security options: name=apparmor name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -j test ``` ### Describe issue Environment variables declared in the env section are not set properly. For example, when setting ``` BUILD_DIR: ${{ github.workspace }}/build ``` Running ``` echo "${BUILD_DIR}" ``` Still outputs the same as running ``` echo "${{ github.workspace }}" ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml name: CI on: push: branches: - master pull_request: branches: - master jobs: test: runs-on: ubuntu-latest strategy: fail-fast: true defaults: run: shell: bash -l {0} env: BUILD_DIR: ${{ github.workspace }}/build steps: - name: Test run: | echo "${{ github.workspace }}" echo "${BUILD_DIR}" ``` ### Relevant log output ```sh [CI/test] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [CI/test] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false [CI/test] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI/test] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI/test] 🐳 docker exec cmd=[chown -R 0:0 /home/jo/software/cadet/CADET] user=0 workdir= [CI/test] ⭐ Run Main Test [CI/test] 🐳 docker exec cmd=[bash -l /var/run/act/workflow/0] user= workdir= | /home/jo/software/cadet/CADET | /home/jo/software/cadet/CADET [CI/test] ✅ Success - Main Test [CI/test] 🏁 Job succeeded ``` ### Additional information _No response_
kerem 2026-03-01 21:45:35 +03:00
  • closed this issue
  • added the
    kind/bug
    label
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#695
No description provided.