[GH-ISSUE #2591] Difference between github and act when running contains(needs.*.result, 'success') #1179

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

Originally created by @m1r4c on GitHub (Dec 29, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2591

Bug report info

act version:            0.2.70
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 24
Docker host:            unix:///run/user/1002//podman/podman.sock
Sockets found:
        /var/run/docker.sock(broken)
        $XDG_RUNTIME_DIR/podman/podman.sock
Config files:
        /home/xx/.config/act/actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.21.13
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.70 -X main.commit=9c7f103bb39f11430f58c1a68d5629a42e6d56a1 -X main.date=2024-12-01T02:37:38Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         9c7f103bb39f11430f58c1a68d5629a42e6d56a1
                vcs.time:             2024-12-01T02:37:19Z
                vcs.modified:         false
Docker Engine:
        Engine version:        4.9.3
        Engine runtime:        crun
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay
        Registry URI:
        OS:                    ubuntu
        OS type:               linux
        OS version:            24.04
        OS arch:               amd64
        OS kernel:             5.15.167.4-microsoft-standard-WSL2
        OS CPU:                24
        OS memory:             32037 MB
        Security options:
                name=seccomp,profile=default
                name=rootless

Command used with act

act

Describe issue

Hello and thank you for this awesome tool!

Wanted to report an issue I am having where there seems to be a difference between how github actions handles it and this tool.

I am trying to specify a job which is dependant on two other jobs where the other jobs are reporting success but the job which is dependant on the other two jobs is finishing with an error when running it with act.

The relevant part is there I am checking for ${{ contains(needs.*.result, 'success') }} which on github actions reports true:
image

but this tool (act) reports false:
image

I created a sample repository to demonstrate this: https://github.com/ldomesjo/testing-github-actions

BR
Lars

https://github.com/ldomesjo/testing-github-actions

Workflow content

name: learn-github-actions
run-name: ${{ github.actor }} is learning GitHub Actions
on: [push]
jobs:
  first-job:
    runs-on: ubuntu-latest
    steps:
      - run: echo meh
  second-job:
    runs-on: ubuntu-latest
    steps:
      - run: echo meh
  third-job:
    runs-on: ubuntu-latest
    needs:
      - first-job
      - second-job
    steps:
      - run: echo '${{ toJSON(needs) }}'
      - run: echo ${{ contains(needs.*.result, 'success') }}

Relevant log output

[learn-github-actions/third-job ]   ✅  Success - Main echo '{
  "first-job": {
    "outputs": null,
    "result": "success"
  },
  "second-job": {
    "outputs": null,
    "result": "success"
  }
}'
[learn-github-actions/third-job ] ⭐ Run Main echo false
[learn-github-actions/third-job ]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir=
| false
[learn-github-actions/third-job ]   ✅  Success - Main echo false
[learn-github-actions/third-job ] Cleaning up container for job third-job
[learn-github-actions/third-job ] 🏁  Job succeeded

Additional information

No response

Originally created by @m1r4c on GitHub (Dec 29, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2591 ### Bug report info ```plain text act version: 0.2.70 GOOS: linux GOARCH: amd64 NumCPU: 24 Docker host: unix:///run/user/1002//podman/podman.sock Sockets found: /var/run/docker.sock(broken) $XDG_RUNTIME_DIR/podman/podman.sock Config files: /home/xx/.config/act/actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.21.13 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.70 -X main.commit=9c7f103bb39f11430f58c1a68d5629a42e6d56a1 -X main.date=2024-12-01T02:37:38Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 9c7f103bb39f11430f58c1a68d5629a42e6d56a1 vcs.time: 2024-12-01T02:37:19Z vcs.modified: false Docker Engine: Engine version: 4.9.3 Engine runtime: crun Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay Registry URI: OS: ubuntu OS type: linux OS version: 24.04 OS arch: amd64 OS kernel: 5.15.167.4-microsoft-standard-WSL2 OS CPU: 24 OS memory: 32037 MB Security options: name=seccomp,profile=default name=rootless ``` ### Command used with act ```sh act ``` ### Describe issue Hello and thank you for this awesome tool! Wanted to report an issue I am having where there seems to be a difference between how github actions handles it and this tool. I am trying to specify a job which is dependant on two other jobs where the other jobs are reporting success but the job which is dependant on the other two jobs is finishing with an error when running it with act. The relevant part is there I am checking for `${{ contains(needs.*.result, 'success') }}` which on github actions reports true: ![image](https://github.com/user-attachments/assets/0999201e-af7b-48f0-91ef-161bf335f5d1) but this tool (act) reports false: ![image](https://github.com/user-attachments/assets/9b4d57dd-b2e3-433f-8189-ee0230a44482) I created a sample repository to demonstrate this: https://github.com/ldomesjo/testing-github-actions BR Lars ### Link to GitHub repository https://github.com/ldomesjo/testing-github-actions ### Workflow content ```yml name: learn-github-actions run-name: ${{ github.actor }} is learning GitHub Actions on: [push] jobs: first-job: runs-on: ubuntu-latest steps: - run: echo meh second-job: runs-on: ubuntu-latest steps: - run: echo meh third-job: runs-on: ubuntu-latest needs: - first-job - second-job steps: - run: echo '${{ toJSON(needs) }}' - run: echo ${{ contains(needs.*.result, 'success') }} ``` ### Relevant log output ```sh [learn-github-actions/third-job ] ✅ Success - Main echo '{ "first-job": { "outputs": null, "result": "success" }, "second-job": { "outputs": null, "result": "success" } }' [learn-github-actions/third-job ] ⭐ Run Main echo false [learn-github-actions/third-job ] 🐳 docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir= | false [learn-github-actions/third-job ] ✅ Success - Main echo false [learn-github-actions/third-job ] Cleaning up container for job third-job [learn-github-actions/third-job ] 🏁 Job succeeded ``` ### Additional information _No response_
kerem 2026-03-01 21:49:29 +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#1179
No description provided.