[GH-ISSUE #507] Additional run when using matrix #347

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

Originally created by @azzazzel on GitHub (Jan 28, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/507

With

❯ act --version
act version 0.2.19

and this workflow (taken from the docs for the sole purpose of demonstrating the issue) :

name: Node.js CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - node-version: 10.x
            site: "prod"
            datacenter: "site-a"
          - node-version: 12.x
            site: "dev"
            datacenter: "site-b"
    steps:
      - name: Echo site details
        env:
          SITE: ${{ matrix.site }}
          DATACENTER: ${{ matrix.datacenter }}
        run: echo $SITE $DATACENTER

There are 3 runs instead of 2:

❯ act
[Node.js CI/build-1] 🚀  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-3] 🧪  Matrix: map[datacenter:site-b node-version:12.x site:dev]
[Node.js CI/build-2] 🧪  Matrix: map[datacenter:site-a node-version:10.x site:prod]
[Node.js CI/build-3] 🚀  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-2] 🚀  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-2]   🐳  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-3]   🐳  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-1]   🐳  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-3] ⭐  Run Echo site details
[Node.js CI/build-2] ⭐  Run Echo site details
[Node.js CI/build-1] ⭐  Run Echo site details
| prod site-a
| dev site-b
[Node.js CI/build-2]   ✅  Success - Echo site details
[Node.js CI/build-3]   ✅  Success - Echo site details
| 
[Node.js CI/build-1]   ✅  Success - Echo site details

As you can see one of them does not have the variables set up correctly. In the real scenario that causes jobs (and thus the whole workflow) to fail when running it with act.

Originally created by @azzazzel on GitHub (Jan 28, 2021). Original GitHub issue: https://github.com/nektos/act/issues/507 With ```shell ❯ act --version act version 0.2.19 ``` and this workflow _(taken from [the docs](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-environment-variables-in-a-matrix) for the sole purpose of demonstrating the issue)_ : ``` name: Node.js CI on: [push] jobs: build: runs-on: ubuntu-latest strategy: matrix: include: - node-version: 10.x site: "prod" datacenter: "site-a" - node-version: 12.x site: "dev" datacenter: "site-b" steps: - name: Echo site details env: SITE: ${{ matrix.site }} DATACENTER: ${{ matrix.datacenter }} run: echo $SITE $DATACENTER ``` There are 3 runs instead of 2: ``` ❯ act [Node.js CI/build-1] 🚀 Start image=catthehacker/ubuntu:act-latest [Node.js CI/build-3] 🧪 Matrix: map[datacenter:site-b node-version:12.x site:dev] [Node.js CI/build-2] 🧪 Matrix: map[datacenter:site-a node-version:10.x site:prod] [Node.js CI/build-3] 🚀 Start image=catthehacker/ubuntu:act-latest [Node.js CI/build-2] 🚀 Start image=catthehacker/ubuntu:act-latest [Node.js CI/build-2] 🐳 docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Node.js CI/build-3] 🐳 docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Node.js CI/build-1] 🐳 docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Node.js CI/build-3] ⭐ Run Echo site details [Node.js CI/build-2] ⭐ Run Echo site details [Node.js CI/build-1] ⭐ Run Echo site details | prod site-a | dev site-b [Node.js CI/build-2] ✅ Success - Echo site details [Node.js CI/build-3] ✅ Success - Echo site details | [Node.js CI/build-1] ✅ Success - Echo site details ``` As you can see one of them does not have the variables set up correctly. In the real scenario that causes jobs (and thus the whole workflow) to fail when running it with act.
kerem 2026-03-01 21:42:34 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@edtan commented on GitHub (Jan 28, 2021):

This was fixed in #503. Unfortunately, a new release with the fix hasn't been released yet, but if you build act from master, it should result in only 2 builds.

<!-- gh-comment-id:769464192 --> @edtan commented on GitHub (Jan 28, 2021): This was fixed in #503. Unfortunately, a new release with the fix hasn't been released yet, but if you build `act` from master, it should result in only 2 builds.
Author
Owner

@azzazzel commented on GitHub (Jan 29, 2021):

Thanks for the update.
As I'm not dealing with Go on a daily basis I'd rather wait for the next release than investing time in installing and learning the toolchain needed to build Go apps. I hope I will not have to wait too long.

<!-- gh-comment-id:769721780 --> @azzazzel commented on GitHub (Jan 29, 2021): Thanks for the update. As I'm not dealing with Go on a daily basis I'd rather wait for the next release than investing time in installing and learning the toolchain needed to build Go apps. I hope I will not have to wait too long.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2021):

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

<!-- gh-comment-id:787557294 --> @github-actions[bot] commented on GitHub (Mar 1, 2021): 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#347
No description provided.