Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: matrix example works in github but not in act #909

Closed
nitrocode opened this issue Dec 2, 2021 · 4 comments
Closed

Issue: matrix example works in github but not in act #909

nitrocode opened this issue Dec 2, 2021 · 4 comments
Labels
kind/bug Something isn't working meta/duplicate This issue or pull request already exists

Comments

@nitrocode
Copy link

System information

  • Operating System: osx
  • Architecture: 64
  • Apple M1: no
  • Docker version: 20.10.8
  • Docker image used in act: Start image=catthehacker/ubuntu:act-latest
  • act version: act version 0.2.24

Expected behaviour

Run job1 and then run job2

Actual behaviour

Runs job1

Workflow and/or repository

This workflow is taken from this example https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object

workflow
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

Steps to reproduce

act -j job1
act -j job2

act output

Log
✗ act -j job2 --verbose
DEBU[0000] Loading environment from /Users/user/git/github/Crypto-Model/vygr-infra/.env
DEBU[0000] Loading secrets from /Users/user/git/github/Crypto-Model/vygr-infra/.secrets
DEBU[0000] Loading workflows from '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'docker-build-github-actions-runner.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build-github-actions-runner.yaml'
DEBU[0000] Found workflow 'docker-build.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build.yaml'
DEBU[0000] Found workflow 'example.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/example.yaml'
DEBU[0000] Found workflow 'labeler.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/labeler.yaml'
DEBU[0000] Found workflow 'pre-commit.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/pre-commit.yaml'
DEBU[0000] Found workflow 'test.json' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/test.json'
DEBU[0000] Found workflow 'test2.json' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/test2.json'
DEBU[0000] Found workflow 'validate-codeowners.yaml' in '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/validate-codeowners.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build-github-actions-runner.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build-github-actions-runner.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/docker-build.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/example.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/example.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/labeler.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/labeler.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/pre-commit.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/pre-commit.yaml'
DEBU[0000] Reading workflow '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/validate-codeowners.yaml'
DEBU[0000] Correcting if statements '/Users/user/git/github/Crypto-Model/vygr-infra/.github/workflows/validate-codeowners.yaml'
DEBU[0000] Planning job: job2
DEBU[0000] Loading slug from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] Loading revision from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] HEAD points to '3051e2500d74be9e80e2bda460a6e94726ff65bf'
DEBU[0000] using github ref: refs/heads/VOYAGER-140-gha-matrix-gh-org
DEBU[0000] context env => map[ACT:true]
DEBU[0000] context needs => map[]
[build/job1] 🚀  Start image=catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] Loading revision from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] HEAD points to '3051e2500d74be9e80e2bda460a6e94726ff65bf'
DEBU[0000] using github ref: refs/heads/VOYAGER-140-gha-matrix-gh-org
[build/job1]   🐳  docker pull catthehacker/ubuntu:act-latest
DEBU[0000] Image exists? true
[build/job1]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[build/job1] Created container name=act-build-job1 id=a80bc9e8520a196bd313c50f5f83e6a753311a4c7cbec41ccab6eb9fe172319d from image catthehacker/ubuntu:act-latest (platform: )
[build/job1] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[build/job1]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[build/job1] Starting container: a80bc9e8520a196bd313c50f5f83e6a753311a4c7cbec41ccab6eb9fe172319d
[build/job1] Started container: a80bc9e8520a196bd313c50f5f83e6a753311a4c7cbec41ccab6eb9fe172319d
[build/job1]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[build/job1] Exec command '[mkdir -m 0777 -p /var/run/act]'
DEBU[0000] Writing entry to tarball workflow/event.json len:2
DEBU[0000] Writing entry to tarball workflow/envs.txt len:0
DEBU[0000] Writing entry to tarball workflow/paths.txt len:0
[build/job1] Extracting content to '/var/run/act/'
DEBU[0000] Loading slug from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] Loading revision from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] HEAD points to '3051e2500d74be9e80e2bda460a6e94726ff65bf'
DEBU[0000] using github ref: refs/heads/VOYAGER-140-gha-matrix-gh-org
DEBU[0000] Loading slug from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] Loading revision from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0000] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0000] HEAD points to '3051e2500d74be9e80e2bda460a6e94726ff65bf'
DEBU[0000] using github ref: refs/heads/VOYAGER-140-gha-matrix-gh-org
DEBU[0000] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEPLOYMENT_BASEPATH:/opt/runner IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0000] context needs => map[]
DEBU[0000] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set-matrix GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:job1 GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/VOYAGER-140-gha-matrix-gh-org GITHUB_REPOSITORY:Crypto-model/vygr-infra GITHUB_REPOSITORY_OWNER:Crypto-model GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3051e2500d74be9e80e2bda460a6e94726ff65bf GITHUB_TOKEN: GITHUB_WORKFLOW:build GITHUB_WORKSPACE:/Users/user/git/github/Crypto-Model/vygr-infra IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[build/job1] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set-matrix GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:job1 GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/VOYAGER-140-gha-matrix-gh-org GITHUB_REPOSITORY:Crypto-model/vygr-infra GITHUB_REPOSITORY_OWNER:Crypto-model GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3051e2500d74be9e80e2bda460a6e94726ff65bf GITHUB_TOKEN: GITHUB_WORKFLOW:build GITHUB_WORKSPACE:/Users/user/git/github/Crypto-Model/vygr-infra IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[build/job1] ⭐  Run echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
DEBU[0000] Wrote command '
echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
' to 'workflow/set-matrix'
DEBU[0000] Writing entry to tarball workflow/set-matrix len:136
[build/job1] Extracting content to '/Users/user/git/github/Crypto-Model/vygr-infra'
[build/job1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/user/git/github/Crypto-Model/vygr-infra/workflow/set-matrix] user=
[build/job1] Exec command '[bash --noprofile --norc -e -o pipefail /Users/user/git/github/Crypto-Model/vygr-infra/workflow/set-matrix]'
[build/job1]   ⚙  ::set-output:: matrix={"include":[{"project":"foo","config":"Debug"},{"project":"bar","config":"Release"}]}
DEBU[0001] Loading slug from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0001] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0001] Loading revision from git directory '/Users/user/git/github/Crypto-Model/vygr-infra/.git'
DEBU[0001] Found revision: 3051e2500d74be9e80e2bda460a6e94726ff65bf
DEBU[0001] HEAD points to '3051e2500d74be9e80e2bda460a6e94726ff65bf'
DEBU[0001] using github ref: refs/heads/VOYAGER-140-gha-matrix-gh-org
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEPLOYMENT_BASEPATH:/opt/runner IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] context needs => map[]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:set-matrix GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:job1 GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/VOYAGER-140-gha-matrix-gh-org GITHUB_REPOSITORY:Crypto-model/vygr-infra GITHUB_REPOSITORY_OWNER:Crypto-model GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3051e2500d74be9e80e2bda460a6e94726ff65bf GITHUB_TOKEN: GITHUB_WORKFLOW:build GITHUB_WORKSPACE:/Users/user/git/github/Crypto-Model/vygr-infra IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] Evaluating 'steps['set-matrix']['outputs']['matrix']' instead of 'steps.set-matrix.outputs.matrix'
[build/job1]   ✅  Success - echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
[build/job1] Removed container: a80bc9e8520a196bd313c50f5f83e6a753311a4c7cbec41ccab6eb9fe172319d
[build/job1]   🐳  docker volume rm act-build-job1
@nitrocode nitrocode added the kind/bug Something isn't working label Dec 2, 2021
@souravsaraf123

This comment has been minimized.

@freearhey
Copy link

freearhey commented Dec 12, 2021

Here is another example:

https://stackoverflow.com/a/62953566

name: test
on:
  workflow_dispatch:
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: echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
Log
[test/job1] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[test/job1]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[test/job1]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job1]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job1]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[test/job1] ⭐  Run echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
[test/job1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/Arhey/Code/iptv-org/iptv/workflow/set-matrix] user= workdir=
[test/job1]   ⚙  ::set-output:: matrix={"include":[{"project":"foo","config":"Debug"},{"project":"bar","config":"Release"}]}
[test/job1]   ✅  Success - echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
[test/job2] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[test/job2]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[test/job2]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[test/job2] ⭐  Run echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
[test/job2]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/Arhey/Code/iptv-org/iptv/workflow/0] user= workdir=
| project=; config=
[test/job2]   ✅  Success - echo "project=${{ matrix.project }}; config=${{ matrix.config }}"

And here is an example that currently gives the correct result:

name: test
on:
  workflow_dispatch:
jobs:
  job2:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        project: []
        config: []
        include:
          - project: foo
            config: Debug
          - project: bar
            config: Release
    steps:
      - run: echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
Log
[test/job2-1] 🧪  Matrix: map[config:Debug project:foo]
[test/job2-1] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[test/job2-2] 🧪  Matrix: map[config:Release project:bar]
[test/job2-2] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[test/job2-1]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[test/job2-2]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[test/job2-1]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2-2]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2-2]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2-1]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[test/job2-1]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[test/job2-2]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[test/job2-1] ⭐  Run echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
[test/job2-2] ⭐  Run echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
[test/job2-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/Arhey/Code/iptv-org/iptv/workflow/0] user= workdir=
[test/job2-2]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/Arhey/Code/iptv-org/iptv/workflow/0] user= workdir=
| project=foo; config=Debug
[test/job2-1]   ✅  Success - echo "project=${{ matrix.project }}; config=${{ matrix.config }}"
| project=bar; config=Release
[test/job2-2]   ✅  Success - echo "project=${{ matrix.project }}; config=${{ matrix.config }}"

@catthehacker
Copy link
Member

Duplicate of #769

@catthehacker catthehacker marked this as a duplicate of #769 Dec 12, 2021
@catthehacker catthehacker added the meta/duplicate This issue or pull request already exists label Dec 12, 2021
@grigorye
Copy link
Contributor

grigorye commented Jun 2, 2022

And here is an example that currently gives the correct result:

name: test
on:
  workflow_dispatch:
jobs:
  job2:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        project: []
        config: []
        include:
          - project: foo
            config: Debug
          - project: bar
            config: Release
    steps:
      - run: echo "project=${{ matrix.project }}; config=${{ matrix.config }}"

@freearhey While it indeed works as a workaround (thanks a lot for figuring it out!), empty arrays break "real" GitHub action runner with "The workflow is not valid. ... Matrix vector xxx does not contain any values" error. Do you have any idea of a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working meta/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants