[GH-ISSUE #2287] Not able to use background tasks #1065

Closed
opened 2026-03-01 21:48:38 +03:00 by kerem · 3 comments
Owner

Originally created by @user-cube on GitHub (Apr 10, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2287

Bug report info

act version:            0.2.61
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 11
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
        $HOME/.docker/run/docker.sock
Config files:           
        /Users/ruicoelho/.actrc:
                -s GITHUB_TOKEN=
                -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.22.1
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.61
                DefaultGODEBUG:       httplaxcontentlength=1,httpmuxgo121=1,panicnil=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
Docker Engine:
        Engine version:        25.0.3
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             6.6.16-linuxkit
        OS CPU:                11
        OS memory:             13461 MB
        Security options:
                name=seccomp,profile=unconfined
                name=cgroupns

Command used with act

act -W .github/workflows/node.yml

Describe issue

When running a pipeline intended to execute tasks in the background, the tool doesn't behave the same way as GitHub Actions; the task is almost ignored, with the step being considered successful.

Is there any way to adapt this so that I can have the same behavior as in GitHub Actions?

Example of working action

Act

image

https://github.com/user-cube/act

Workflow content

name: 'Background task'

on:
  push:

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - run: npm install
      - run: node app.js &
      - run: npx wait-on http://localhost:3000

Relevant log output

act -W .github/workflows/node.yml
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock'
WARN  ⚠ You are using Apple M-series 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'. ⚠
[Background task/setup] 🚀  Start image=catthehacker/ubuntu:act-latest
[Background task/setup]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Background task/setup]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Background task/setup]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Background task/setup]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v2
[Background task/setup] ⭐ Run Main actions/checkout@v2
[Background task/setup]   🐳  docker cp src=/Users/ruicoelho/personal/act/. dst=/Users/ruicoelho/personal/act
[Background task/setup]   ✅  Success - Main actions/checkout@v2
[Background task/setup] ⭐ Run Main actions/setup-node@v2
[Background task/setup]   🐳  docker cp src=/Users/ruicoelho/.cache/act/actions-setup-node@v2/ dst=/var/run/act/actions/actions-setup-node@v2/
[Background task/setup]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-node@v2/dist/setup/index.js] user= workdir=
[Background task/setup]   💬  ::debug::isExplicit:
[Background task/setup]   💬  ::debug::explicit? false
[Background task/setup]   💬  ::debug::isExplicit: 14.21.3
[Background task/setup]   💬  ::debug::explicit? true
[Background task/setup]   💬  ::debug::evaluating 1 versions
[Background task/setup]   💬  ::debug::matched: 14.21.3
[Background task/setup]   💬  ::debug::checking cache: /opt/hostedtoolcache/node/14.21.3/arm64
[Background task/setup]   💬  ::debug::Found tool in cache node 14.21.3 arm64
| Found in cache @ /opt/hostedtoolcache/node/14.21.3/arm64
[Background task/setup]   ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/tsc.json
[Background task/setup]   ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/eslint-stylish.json
[Background task/setup]   ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/eslint-compact.json
[Background task/setup]   ✅  Success - Main actions/setup-node@v2
[Background task/setup]   ⚙  ::add-path:: /opt/hostedtoolcache/node/14.21.3/arm64/bin
[Background task/setup] ⭐ Run Main npm install
[Background task/setup]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir=
| npm WARN act@1.0.0 No description
| npm WARN act@1.0.0 No repository field.
|
| added 64 packages from 41 contributors and audited 64 packages in 1.425s
|
| 12 packages are looking for funding
|   run `npm fund` for details
|
| found 0 vulnerabilities
|
[Background task/setup]   ✅  Success - Main npm install
[Background task/setup] ⭐ Run Main node app.js &
[Background task/setup]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
[Background task/setup]   ✅  Success - Main node app.js &
[Background task/setup] ⭐ Run Main npx wait-on http://localhost:3000
[Background task/setup]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=
| npx: installed 20 in 6.088s

Additional information

No response

Originally created by @user-cube on GitHub (Apr 10, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2287 ### Bug report info ```plain text act version: 0.2.61 GOOS: darwin GOARCH: arm64 NumCPU: 11 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock $HOME/.docker/run/docker.sock Config files: /Users/ruicoelho/.actrc: -s GITHUB_TOKEN= -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.22.1 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.61 DefaultGODEBUG: httplaxcontentlength=1,httpmuxgo121=1,panicnil=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin Docker Engine: Engine version: 25.0.3 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 6.6.16-linuxkit OS CPU: 11 OS memory: 13461 MB Security options: name=seccomp,profile=unconfined name=cgroupns ``` ### Command used with act ```sh act -W .github/workflows/node.yml ``` ### Describe issue When running a pipeline intended to execute tasks in the background, the tool doesn't behave the same way as GitHub Actions; the task is almost ignored, with the step being considered successful. Is there any way to adapt this so that I can have the same behavior as in GitHub Actions? [Example of working action](https://github.com/user-cube/act/actions/runs/8624301256/job/23639052938) Act <img width="1428" alt="image" src="https://github.com/nektos/act/assets/33549232/aa249f51-27b0-4253-b4ff-0c904770e1a8"> ### Link to GitHub repository https://github.com/user-cube/act ### Workflow content ```yml name: 'Background task' on: push: jobs: setup: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: '14' - run: npm install - run: node app.js & - run: npx wait-on http://localhost:3000 ``` ### Relevant log output ```sh act -W .github/workflows/node.yml INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' WARN ⚠ You are using Apple M-series 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'. ⚠ [Background task/setup] 🚀 Start image=catthehacker/ubuntu:act-latest [Background task/setup] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Background task/setup] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [Background task/setup] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [Background task/setup] ☁ git clone 'https://github.com/actions/setup-node' # ref=v2 [Background task/setup] ⭐ Run Main actions/checkout@v2 [Background task/setup] 🐳 docker cp src=/Users/ruicoelho/personal/act/. dst=/Users/ruicoelho/personal/act [Background task/setup] ✅ Success - Main actions/checkout@v2 [Background task/setup] ⭐ Run Main actions/setup-node@v2 [Background task/setup] 🐳 docker cp src=/Users/ruicoelho/.cache/act/actions-setup-node@v2/ dst=/var/run/act/actions/actions-setup-node@v2/ [Background task/setup] 🐳 docker exec cmd=[node /var/run/act/actions/actions-setup-node@v2/dist/setup/index.js] user= workdir= [Background task/setup] 💬 ::debug::isExplicit: [Background task/setup] 💬 ::debug::explicit? false [Background task/setup] 💬 ::debug::isExplicit: 14.21.3 [Background task/setup] 💬 ::debug::explicit? true [Background task/setup] 💬 ::debug::evaluating 1 versions [Background task/setup] 💬 ::debug::matched: 14.21.3 [Background task/setup] 💬 ::debug::checking cache: /opt/hostedtoolcache/node/14.21.3/arm64 [Background task/setup] 💬 ::debug::Found tool in cache node 14.21.3 arm64 | Found in cache @ /opt/hostedtoolcache/node/14.21.3/arm64 [Background task/setup] ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/tsc.json [Background task/setup] ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/eslint-stylish.json [Background task/setup] ❓ add-matcher /run/act/actions/actions-setup-node@v2/.github/eslint-compact.json [Background task/setup] ✅ Success - Main actions/setup-node@v2 [Background task/setup] ⚙ ::add-path:: /opt/hostedtoolcache/node/14.21.3/arm64/bin [Background task/setup] ⭐ Run Main npm install [Background task/setup] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= | npm WARN act@1.0.0 No description | npm WARN act@1.0.0 No repository field. | | added 64 packages from 41 contributors and audited 64 packages in 1.425s | | 12 packages are looking for funding | run `npm fund` for details | | found 0 vulnerabilities | [Background task/setup] ✅ Success - Main npm install [Background task/setup] ⭐ Run Main node app.js & [Background task/setup] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= [Background task/setup] ✅ Success - Main node app.js & [Background task/setup] ⭐ Run Main npx wait-on http://localhost:3000 [Background task/setup] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir= | npx: installed 20 in 6.088s ``` ### Additional information _No response_
kerem 2026-03-01 21:48:38 +03:00
Author
Owner

@Papillon6814 commented on GitHub (May 22, 2024):

Same issue here

<!-- gh-comment-id:2125199468 --> @Papillon6814 commented on GitHub (May 22, 2024): Same issue here
Author
Owner

@github-actions[bot] commented on GitHub (Nov 19, 2024):

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

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

@NBS-LLC commented on GitHub (Dec 8, 2024):

This is still an issue in version 0.2.70

<!-- gh-comment-id:2525364508 --> @NBS-LLC commented on GitHub (Dec 8, 2024): This is still an issue in version 0.2.70
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#1065
No description provided.