[GH-ISSUE #1797] Support needs.*.result not working for multiple job status #879

Closed
opened 2026-03-01 21:47:06 +03:00 by kerem · 1 comment
Owner

Originally created by @adrianruizmora on GitHub (May 10, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1797

Bug report info

act version:            0.2.45
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
        $HOME/.docker/run/docker.sock
Config files:           
        /Users/adrian/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:full-latest
                -P ubuntu-latest=catthehacker/ubuntu:full-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:full-18.04
Build info:
        Go version:            go1.20.3
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.45
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        20.10.21
        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:               x86_64
        OS kernel:             5.15.49-linuxkit
        OS CPU:                2
        OS memory:             3933 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

## Custom script RunPipeline.sh

EVENT="$1"
BRANCH="$2"
SECRET_FILE_PATH=act/secrets/.github-actions.conf
ENV_FILE_PATH="act/.env"
EVENT_PATH="act/payloads/$EVENT-on-$BRANCH.json"
PLATFORM_VERSION="***"
PLATFORM="***.dkr.ecr.eu-west-1.amazonaws.com/***:***"

act -P ubuntu-latest=$PLATFORM --secret-file $SECRET_FILE_PATH \
                               --eventpath $EVENT_PATH \
                               --env-file $ENV_FILE_PATH \
                               --workflows ./act/.github/workflows/ci_cd.yml

Describe issue

When running my workflow with act i expect that the step "random job" will output: "success failure". When running the workflow with github-actions i can access all the status of dependent jobs using the wildcard *

No response

Workflow content

name: CI/CD

on: [push, pull_request]

jobs:

  tests:
    runs-on: ubuntu-latest
    steps:
      - name: node tests
        run: exit 1

  notify:
    needs: tests
    if: always()
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: random job
        run: echo "${{ job.status }} ${{ join(needs.*.result, ' ') }}"

Relevant log output

[CI/CD/notify] [DEBUG] expression 'echo "${{ job.status }} ${{ join(needs.*.result, ' ') }}"' rewritten to 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))'
[CI/CD/notify] [DEBUG] evaluating expression 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))'
[CI/CD/notify] [DEBUG] expression 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))' evaluated to '%!t(string=echo "success ")'
[CI/CD/notify] [DEBUG] Wrote command 

echo "success "

 to 'workflow/1'

Additional information

I was following this tutorial, when i found that it was not working: https://levelup.gitconnected.com/structuring-github-actions-safely-5309e5ee54de

Originally created by @adrianruizmora on GitHub (May 10, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1797 ### Bug report info ```plain text act version: 0.2.45 GOOS: darwin GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock $HOME/.docker/run/docker.sock Config files: /Users/adrian/.actrc: -P ubuntu-latest=catthehacker/ubuntu:full-latest -P ubuntu-latest=catthehacker/ubuntu:full-20.04 -P ubuntu-18.04=catthehacker/ubuntu:full-18.04 Build info: Go version: go1.20.3 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.45 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: darwin GOAMD64: v1 Docker Engine: Engine version: 20.10.21 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: x86_64 OS kernel: 5.15.49-linuxkit OS CPU: 2 OS memory: 3933 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh ## Custom script RunPipeline.sh EVENT="$1" BRANCH="$2" SECRET_FILE_PATH=act/secrets/.github-actions.conf ENV_FILE_PATH="act/.env" EVENT_PATH="act/payloads/$EVENT-on-$BRANCH.json" PLATFORM_VERSION="***" PLATFORM="***.dkr.ecr.eu-west-1.amazonaws.com/***:***" act -P ubuntu-latest=$PLATFORM --secret-file $SECRET_FILE_PATH \ --eventpath $EVENT_PATH \ --env-file $ENV_FILE_PATH \ --workflows ./act/.github/workflows/ci_cd.yml ``` ### Describe issue When running my workflow with act i expect that the step "random job" will output: "success failure". When running the workflow with github-actions i can access all the status of dependent jobs using the wildcard * ### Link to GitHub repository _No response_ ### Workflow content ```yml name: CI/CD on: [push, pull_request] jobs: tests: runs-on: ubuntu-latest steps: - name: node tests run: exit 1 notify: needs: tests if: always() runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: random job run: echo "${{ job.status }} ${{ join(needs.*.result, ' ') }}" ``` ### Relevant log output ```sh [CI/CD/notify] [DEBUG] expression 'echo "${{ job.status }} ${{ join(needs.*.result, ' ') }}"' rewritten to 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))' [CI/CD/notify] [DEBUG] evaluating expression 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))' [CI/CD/notify] [DEBUG] expression 'format('echo "{0} {1}"', job.status, join(needs.*.result, ' '))' evaluated to '%!t(string=echo "success ")' [CI/CD/notify] [DEBUG] Wrote command echo "success " to 'workflow/1' ``` ### Additional information I was following this tutorial, when i found that it was not working: https://levelup.gitconnected.com/structuring-github-actions-safely-5309e5ee54de
kerem 2026-03-01 21:47:06 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2023):

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

<!-- gh-comment-id:1797062941 --> @github-actions[bot] commented on GitHub (Nov 7, 2023): 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#879
No description provided.