[GH-ISSUE #1182] Dynamic matrix with include: does nothing #658

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

Originally created by @jayvdb on GitHub (May 26, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1182

Bug report info

Tested with 0.2.26 and 2.2.27-dev

act version:            v0.2.27-dev
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:
	/Users/jayvdb/.actrc:
		#-P self-hosted=catthehacker/ubuntu:act-latest
		-P self-hosted=ubuntu:jammy
		-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
		ubuntu-16.04=catthehacker/ubuntu:act-16.04
Build info:
	Go version:            go1.18.2
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:
	Build settings:
		-compiler:            gc
		CGO_ENABLED:          1
		CGO_CFLAGS:
		CGO_CPPFLAGS:
		CGO_CXXFLAGS:
		CGO_LDFLAGS:
		GOARCH:               amd64
		GOOS:                 darwin
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         bc0f09b9ea1df599011787f51d296bd793e7cfb5
		vcs.time:             2022-05-24T20:49:12Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.13
	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.10.104-linuxkit
	OS CPU:                2
	OS memory:             7960 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns
act version:            0.2.26
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:
	/Users/jayvdb/.actrc:
		#-P self-hosted=catthehacker/ubuntu:act-latest
		-P self-hosted=ubuntu:jammy
		-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
		ubuntu-16.04=catthehacker/ubuntu:act-16.04
Docker Engine:
	Engine version:        20.10.13
	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.10.104-linuxkit
	OS CPU:                2
	OS memory:             7960 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act -j job2

Describe issue

The example is here https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/7
act -j job2 will run job1 but doesnt run job2.

No response

Workflow content

name: build
on: push
jobs:
  job1:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}
    steps:
    - id: set-matrix
      run: echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
  job2:
    needs: job1
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{fromJson(needs.job1.outputs.matrix)}}
    steps:
    - run: build

Relevant log output

% ~/go/bin/act -j job2
[bug/job1] 🚀  Start image=catthehacker/ubuntu:act-latest
[bug/job1]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[bug/job1]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[bug/job1]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[bug/job1]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[bug/job1] ⭐  Run echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
[bug/job1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/set-matrix] user= workdir=
[bug/job1]   ⚙  ::set-output:: matrix={"include":[{"project":"foo","config":"Debug"},{"project":"bar","config":"Release"}]}
[bug/job1]   ✅  Success - echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"


### Additional information

_No response_
Originally created by @jayvdb on GitHub (May 26, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1182 ### Bug report info Tested with 0.2.26 and 2.2.27-dev ``` act version: v0.2.27-dev GOOS: darwin GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/jayvdb/.actrc: #-P self-hosted=catthehacker/ubuntu:act-latest -P self-hosted=ubuntu:jammy -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 ubuntu-16.04=catthehacker/ubuntu:act-16.04 Build info: Go version: go1.18.2 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: darwin GOAMD64: v1 vcs: git vcs.revision: bc0f09b9ea1df599011787f51d296bd793e7cfb5 vcs.time: 2022-05-24T20:49:12Z vcs.modified: false Docker Engine: Engine version: 20.10.13 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.10.104-linuxkit OS CPU: 2 OS memory: 7960 MB Security options: name=seccomp,profile=default name=cgroupns ``` ``` act version: 0.2.26 GOOS: darwin GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/jayvdb/.actrc: #-P self-hosted=catthehacker/ubuntu:act-latest -P self-hosted=ubuntu:jammy -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 ubuntu-16.04=catthehacker/ubuntu:act-16.04 Docker Engine: Engine version: 20.10.13 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.10.104-linuxkit OS CPU: 2 OS memory: 7960 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -j job2 ``` ### Describe issue The example is here https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/7 `act -j job2` will run `job1` but doesnt run job2. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: build on: push jobs: job1: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - id: set-matrix run: echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}" job2: needs: job1 runs-on: ubuntu-latest strategy: matrix: ${{fromJson(needs.job1.outputs.matrix)}} steps: - run: build ``` ### Relevant log output ```sh % ~/go/bin/act -j job2 [bug/job1] 🚀 Start image=catthehacker/ubuntu:act-latest [bug/job1] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [bug/job1] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [bug/job1] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [bug/job1] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [bug/job1] ⭐ Run echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}" [bug/job1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/set-matrix] user= workdir= [bug/job1] ⚙ ::set-output:: matrix={"include":[{"project":"foo","config":"Debug"},{"project":"bar","config":"Release"}]} [bug/job1] ✅ Success - echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}" ``` ``` ### Additional information _No response_
kerem 2026-03-01 21:45:19 +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#658
No description provided.