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: Dynamic Matrix not working #927

Closed
aurimasniekis opened this issue Dec 14, 2021 · 7 comments · Fixed by #964
Closed

Issue: Dynamic Matrix not working #927

aurimasniekis opened this issue Dec 14, 2021 · 7 comments · Fixed by #964
Labels
kind/bug Something isn't working

Comments

@aurimasniekis
Copy link

System information

  • Operating System: macOS
  • Architecture: x64 (64-bit)
  • Apple M1: no
  • Docker version: 20.10.8
  • Docker image used in act:
  • act version: act version HEAD-cad4bc8

Expected behaviour

The following workflow file should work, the matrix dynamic value should be evaluated after the first job is done and passed to matrix of second job.

Actual behaviour

Matrix is not evaluated

Workflow and/or repository

workflow
name: "Dynamic Matix"

on:
  pull_request:
  push:

jobs:
  bar:
    name: Bar
    runs-on: ubuntu-latest
    steps:
      - id: output_data
        run: |
          echo '::set-output name=matrix::"{"package": ["a", "b"]}"'
    outputs:
      matrix: ${{ steps.output_data.outputs.matrix }}

  foo:
    name: Foo
    needs: [ bar ]
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{ fromJson(needs.bar.outputs.matrix) }}
    steps:
      - name: foo ${{ matrix.package }}
        run: |
          echo 'Matrix "${{ matrix.package }}" JSON: ${{ toJSON(matrix) }} ${{ needs.bar.outputs.matrix }}'

Steps to reproduce

act output

Log
DEBU[0000] Loading secrets from /tmp/foo/.secrets
DEBU[0000] Loading workflows from '/tmp/foo/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'sample.yaml' in '/tmp/foo/.github/workflows/sample.yaml'
DEBU[0000] Reading workflow '/tmp/foo/.github/workflows/sample.yaml'
DEBU[0000] Correcting if statements '/tmp/foo/.github/workflows/sample.yaml'
DEBU[0000] Planning event: push
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
DEBU[0000] context steps => map[]
DEBU[0000] context env => map[ACT:true]
DEBU[0000]
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
DEBU[0000] context steps => map[]
DEBU[0000] context env => map[ACT:true]
DEBU[0000] expression 'success()' evaluated to 'true'
[Dynamic Matix/Bar] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
[Dynamic Matix/Bar]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Dynamic Matix/Bar]   🐳  docker pull ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0000] Image exists? true
[Dynamic Matix/Bar]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Dynamic Matix/Bar] Created container name=act-Dynamic-Matix-Bar id=87b64055fc9b58ced103cf6e968da2bc3bf5be7dc9bcb4f8895c9800109a6e1f from image ghcr.io/catthehacker/ubuntu:act-latest (platform: )
[Dynamic Matix/Bar] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Dynamic Matix/Bar]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Dynamic Matix/Bar] Starting container: 87b64055fc9b58ced103cf6e968da2bc3bf5be7dc9bcb4f8895c9800109a6e1f
[Dynamic Matix/Bar] Started container: 87b64055fc9b58ced103cf6e968da2bc3bf5be7dc9bcb4f8895c9800109a6e1f
[Dynamic Matix/Bar]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Dynamic Matix/Bar] Exec command '[mkdir -m 0777 -p /var/run/act]'
[Dynamic Matix/Bar] Working directory '/tmp/foo'
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
[Dynamic Matix/Bar] Extracting content to '/var/run/act/'
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
DEBU[0000] context steps => map[output_data:map[conclusion:success outcome:success outputs:map[]]]
DEBU[0000] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEBIAN_FRONTEND:noninteractive 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 env => map[]
DEBU[0000] context needs => map[]
DEBU[0000] expression 'success()' evaluated to 'true'
WARN[0000] unable to get git repo: unable to find git repo
WARN[0000] unable to get git revision: unable to find git repo
WARN[0000] unable to get git ref: unable to find git repo
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
DEBU[0001] context steps => map[output_data:map[conclusion:success outcome:success outputs:map[]]]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:output_data 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:Bar GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:output_data 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:Bar GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] context needs => map[]
[Dynamic Matix/Bar] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:output_data 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:Bar GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[Dynamic Matix/Bar] ⭐  Run echo '::set-output name=matrix::"{"package": ["a", "b"]}"'
DEBU[0001] Wrote command '
echo '::set-output name=matrix::"{"package": ["a", "b"]}"'

' to 'workflow/output_data'
DEBU[0001] Writing entry to tarball workflow/output_data len:59
[Dynamic Matix/Bar] Extracting content to '/tmp/foo'
[Dynamic Matix/Bar]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /tmp/foo/workflow/output_data] user= workdir=
[Dynamic Matix/Bar] Exec command '[bash --noprofile --norc -e -o pipefail /tmp/foo/workflow/output_data]'
[Dynamic Matix/Bar] Working directory '/tmp/foo'
[Dynamic Matix/Bar]   ⚙  ::set-output:: matrix="{"package": ["a", "b"]}"
[Dynamic Matix/Bar]   ✅  Success - echo '::set-output name=matrix::"{"package": ["a", "b"]}"'
[Dynamic Matix/Bar] Removed container: 87b64055fc9b58ced103cf6e968da2bc3bf5be7dc9bcb4f8895c9800109a6e1f
[Dynamic Matix/Bar]   🐳  docker volume rm act-Dynamic-Matix-Bar
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
DEBU[0001] context steps => map[output_data:map[conclusion:success outcome:success outputs:map[matrix:"{"package": ["a", "b"]}"]]]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:output_data 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:Bar GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] Evaluating 'steps['output_data']['outputs']['matrix']' instead of 'steps.output_data.outputs.matrix'
DEBU[0001] expression 'success()' evaluated to 'true'
[Dynamic Matix/Foo] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
[Dynamic Matix/Foo]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Dynamic Matix/Foo]   🐳  docker pull ghcr.io/catthehacker/ubuntu:act-latest
DEBU[0001] Image exists? true
[Dynamic Matix/Foo]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Dynamic Matix/Foo] Created container name=act-Dynamic-Matix-Foo id=a2d3eff52f7d22fc4cdbf6a4f6f6b67bd6409725671bda491e641cf165076bf0 from image ghcr.io/catthehacker/ubuntu:act-latest (platform: )
[Dynamic Matix/Foo] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Dynamic Matix/Foo]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Dynamic Matix/Foo] Starting container: a2d3eff52f7d22fc4cdbf6a4f6f6b67bd6409725671bda491e641cf165076bf0
[Dynamic Matix/Foo] Started container: a2d3eff52f7d22fc4cdbf6a4f6f6b67bd6409725671bda491e641cf165076bf0
[Dynamic Matix/Foo]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Dynamic Matix/Foo] Exec command '[mkdir -m 0777 -p /var/run/act]'
[Dynamic Matix/Foo] Working directory '/tmp/foo'
DEBU[0001] Writing entry to tarball workflow/event.json len:2
DEBU[0001] Writing entry to tarball workflow/envs.txt len:0
DEBU[0001] Writing entry to tarball workflow/paths.txt len:0
[Dynamic Matix/Foo] Extracting content to '/var/run/act/'
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
DEBU[0001] context steps => map[0:map[conclusion:success outcome:success outputs:map[]]]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEBIAN_FRONTEND:noninteractive 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 env => map[]
DEBU[0001] context needs => map[bar:map[outputs:map[matrix:"{"package": ["a", "b"]}"]]]
DEBU[0001] expression 'success()' evaluated to 'true'
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
DEBU[0001] context steps => map[0:map[conclusion:success outcome:success outputs:map[]]]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 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:Foo GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 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:Foo GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
DEBU[0001] context needs => map[bar:map[outputs:map[matrix:"{"package": ["a", "b"]}"]]]
[Dynamic Matix/Foo] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 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:Foo GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[Dynamic Matix/Foo] ⭐  Run foo ${{ matrix.package }}
DEBU[0001] Evaluating 'matrix['package']' instead of 'matrix.package'
DEBU[0001] Evaluating 'needs['bar']['outputs']['matrix']' instead of 'needs.bar.outputs.matrix'
DEBU[0001] context needs => map[bar:{Outputs:map[matrix:"{"package": ["a", "b"]}"] Result:success}]
DEBU[0001] Wrote command '
echo 'Matrix "" JSON: {} "{"package": ["a", "b"]}"'

' to 'workflow/0'
DEBU[0001] Writing entry to tarball workflow/0 len:52
[Dynamic Matix/Foo] Extracting content to '/tmp/foo'
[Dynamic Matix/Foo]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /tmp/foo/workflow/0] user= workdir=
[Dynamic Matix/Foo] Exec command '[bash --noprofile --norc -e -o pipefail /tmp/foo/workflow/0]'
[Dynamic Matix/Foo] Working directory '/tmp/foo'
| Matrix "" JSON: {} "{"package": ["a", "b"]}"
[Dynamic Matix/Foo]   ✅  Success - foo ${{ matrix.package }}
[Dynamic Matix/Foo] Removed container: a2d3eff52f7d22fc4cdbf6a4f6f6b67bd6409725671bda491e641cf165076bf0
[Dynamic Matix/Foo]   🐳  docker volume rm act-Dynamic-Matix-Foo
WARN[0001] unable to get git repo: unable to find git repo
WARN[0001] unable to get git revision: unable to find git repo
WARN[0001] unable to get git ref: unable to find git repo
DEBU[0001] context steps => map[0:map[conclusion:success outcome:success outputs:map[]]]
DEBU[0001] context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 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:Foo GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF: GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_TOKEN: GITHUB_WORKFLOW:Dynamic Matix GITHUB_WORKSPACE:/tmp/foo 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:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
@aurimasniekis aurimasniekis added the kind/bug Something isn't working label Dec 14, 2021
@aurimasniekis aurimasniekis changed the title Issue: <shortly describe issue> Issue: Dynamic Matrix not working Dec 14, 2021
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Jan 14, 2022
@aurimasniekis
Copy link
Author

Any update?

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Jan 14, 2022

The output of this line doesn't seem to work for me with actions/runner

         echo '::set-output name=matrix::"{"package": ["a", "b"]}"'

It stores value "{"package": ["a", "b"]}" in output matrix => syntax error after evaluating the matrix.
I need to change it to

         echo '::set-output name=matrix::{"package": ["a", "b"]}'

Any update?

Actually no, at least not for nektos/act. I can confirm this bug in act. After fixing the error above, you can use my runner.server utillity to execute it locally like you would expect. I know that my utillity is slower than act, but faster than GitHub Actions.

Log of a run via runner.server
gharun -W dyn-act.yml
Starting Server...
Starting 1 Runner...
The server is listening on http://192.168.178.20:50663
No default github.ref found
Couldn't retrive github.sha
[dyn-act.yml] Running: dyn-act.yml
|Initialize Workflow Run 1
|Parsing Workflow...
|Updated Workflow Name: Dynamic Matix
[Bar] Running: Bar
|Evaluate job name ( pre strategy )
|Evaluate if
|Evaluating: success()
|Evaluating success:
|=> true
|Result: true
|Prepare Job for execution
|Evaluate job name
|Evaluate job ContinueOnError
|Evaluate job timeoutMinutes
|Evaluate job cancelTimeoutMinutes
|Evaluate runs-on
|Queued Job: Bar for queue self-hosted,container-host
|Read Job from Queue: Bar for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
|Sent Job to Runner: Bar for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
[Dynamic Matix / Bar] Running: Set up job
|Current runner version: '3.5.0'
|Runner name: 'Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef'
|Machine name: 'DESKTOP-3SVG86B'
|Prepare workflow directory
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|Prepare all required actions
[Dynamic Matix / Bar] Succeeded: Set up job
[Dynamic Matix / Bar] Running: Initialize containers
|##[group]Checking docker version
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|##[endgroup]
|##[group]Clean up resources from previous jobs
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --quiet --no-trunc --filter "label=df4e78"
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network prune --force --filter "label=df4e78"
|##[endgroup]
|##[group]Create local container network
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network create --label df4e78 github_network_cb49aa20a4ac4b31a1ff13bfe2d503d4
|7e555777733d7ae23aa70a217fe4e26b4592ae792cecf0785f48266ece192d48
|##[endgroup]
|##[group]Starting job container
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE pull catthehacker/ubuntu:act-latest
|act-latest: Pulling from catthehacker/ubuntu
|Digest: sha256:b760bdffae1d8bc4822f0b429ba720d56556d94cc03a2b0e2f2062b67e832e19
|Status: Image is up to date for catthehacker/ubuntu:act-latest
|docker.io/catthehacker/ubuntu:act-latest
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE create --name 8d38386b837d4d71a5d2db1bf8ebb942_catthehackerubuntuactlatest_64cca6 --label df4e78 --workdir /__w/Unknown/Unknown --network github_network_cb49aa20a4ac4b31a1ff13bfe2d503d4  -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock"...
|35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE start 35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --filter id=35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
|35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f Up Less than a second
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE inspect --format "{{range .Config.Env}}{{println .}}{{end}}" 35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|HOME=/github/home
|GITHUB_ACTIONS=true
|CI=true
|PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|DEBIAN_FRONTEND=noninteractive
|##[endgroup]
|##[group]Waiting for all services to be ready
|##[endgroup]
[Dynamic Matix / Bar] Succeeded: Initialize containers
[Dynamic Matix / Bar] Running: Run echo '::set-output name=matrix::{"package": ["a", "b"]}'
|##[group]Run echo '::set-output name=matrix::{"package": ["a", "b"]}'
|echo '::set-output name=matrix::{"package": ["a", "b"]}'
|shell: pwsh -command ". '{0}'"
|##[endgroup]
[Dynamic Matix / Bar] Succeeded: Run echo '::set-output name=matrix::{"package": ["a", "b"]}'
[Dynamic Matix / Bar] Running: Stop containers
|Stop and remove container: 8d38386b837d4d71a5d2db1bf8ebb942_catthehackerubuntuactlatest_64cca6
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE rm --force 35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|35dcd4b96622bc595bceed3a05243be145de53bba268818fb45f8be430b7d90f
|Remove container network: github_network_cb49aa20a4ac4b31a1ff13bfe2d503d4
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network rm github_network_cb49aa20a4ac4b31a1ff13bfe2d503d4
|github_network_cb49aa20a4ac4b31a1ff13bfe2d503d4
[Dynamic Matix / Bar] Succeeded: Stop containers
[Dynamic Matix / Bar] Running: Complete job
|Evaluate and set job outputs
|Set output 'matrix'
|Cleaning up orphan processes
[Dynamic Matix / Bar] Succeeded: Complete job
[Dynamic Matix / Bar] Job Completed with Status: Succeeded
[Foo] Running: Foo
|Evaluate job name ( pre strategy )
|Evaluate if
|Evaluating: success()
|Evaluating success:
|=> true
|Result: true
|Evaluate strategy
|Evaluating: fromJson(needs.bar.outputs.matrix)
|Evaluating fromJson:
|..Evaluating Index:
|....Evaluating Index:
|......Evaluating Index:
|........Evaluating needs:
|........=> Object
|........Evaluating String:
|........=> 'bar'
|......=> Object
|......Evaluating String:
|......=> 'outputs'
|....=> Object
|....Evaluating String:
|....=> 'matrix'
|..=> '{"package": ["a", "b"]}'
|=> Object
|Result: Object
[Dynamic Matix / foo (a)] Running: foo (a)
|Prepare Job for execution
|Evaluate job name
|Evaluate job ContinueOnError
|Evaluate job timeoutMinutes
|Evaluate job cancelTimeoutMinutes
|Evaluate runs-on
[Dynamic Matix / foo (b)] Running: foo (b)
|Prepare Job for execution
|Evaluate job name
|Evaluate job ContinueOnError
|Evaluate job timeoutMinutes
|Evaluate job cancelTimeoutMinutes
|Evaluate runs-on
|Queued Job: Foo for queue self-hosted,container-host
|Queued Job: Foo for queue self-hosted,container-host
|Read Job from Queue: Foo for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
|Sent Job to Runner: Foo for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
[Dynamic Matix / Foo] Running: Set up job
|Current runner version: '3.5.0'
|Runner name: 'Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef'
|Machine name: 'DESKTOP-3SVG86B'
|Prepare workflow directory
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|Prepare all required actions
[Dynamic Matix / Foo] Succeeded: Set up job
[Dynamic Matix / Foo] Running: Initialize containers
|##[group]Checking docker version
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|##[endgroup]
|##[group]Clean up resources from previous jobs
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --quiet --no-trunc --filter "label=df4e78"
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network prune --force --filter "label=df4e78"
|##[endgroup]
|##[group]Create local container network
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network create --label df4e78 github_network_390f9695ac074a1aa44aa998e6fb6ea9
|b053674a1f0064fcad8dc2364db9785b1852eeedc93a93e56c83c547ccd320df
|##[endgroup]
|##[group]Starting job container
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE pull catthehacker/ubuntu:act-latest
|act-latest: Pulling from catthehacker/ubuntu
|Digest: sha256:b760bdffae1d8bc4822f0b429ba720d56556d94cc03a2b0e2f2062b67e832e19
|Status: Image is up to date for catthehacker/ubuntu:act-latest
|docker.io/catthehacker/ubuntu:act-latest
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE create --name 13a360bdeb184570b688cd654d1483f7_catthehackerubuntuactlatest_79258e --label df4e78 --workdir /__w/Unknown/Unknown --network github_network_390f9695ac074a1aa44aa998e6fb6ea9  -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock"...
|c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE start c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --filter id=c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
|c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b Up Less than a second
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE inspect --format "{{range .Config.Env}}{{println .}}{{end}}" c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|HOME=/github/home
|GITHUB_ACTIONS=true
|CI=true
|PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|DEBIAN_FRONTEND=noninteractive
|##[endgroup]
|##[group]Waiting for all services to be ready
|##[endgroup]
[Dynamic Matix / Foo] Succeeded: Initialize containers
[Dynamic Matix / Foo] Running: foo a
|##[group]Run echo 'Matrix "a" JSON: {
|echo 'Matrix "a" JSON: {
|  "package": "a"
|} {"package": ["a", "b"]}'
|shell: pwsh -command ". '{0}'"
|##[endgroup]
|Matrix "a" JSON: {
|  "package": "a"
|} {"package": ["a", "b"]}
[Dynamic Matix / Foo] Succeeded: foo a
[Dynamic Matix / Foo] Running: Stop containers
|Stop and remove container: 13a360bdeb184570b688cd654d1483f7_catthehackerubuntuactlatest_79258e
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE rm --force c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|c845a9353143dc298989a387673b0267572d02ca938e026946d888682a23dd0b
|Remove container network: github_network_390f9695ac074a1aa44aa998e6fb6ea9
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network rm github_network_390f9695ac074a1aa44aa998e6fb6ea9
|github_network_390f9695ac074a1aa44aa998e6fb6ea9
[Dynamic Matix / Foo] Succeeded: Stop containers
[Dynamic Matix / Foo] Running: Complete job
|Cleaning up orphan processes
[Dynamic Matix / Foo] Succeeded: Complete job
[Dynamic Matix / Foo] Job Completed with Status: Succeeded
|Read Job from Queue: Foo for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
|Sent Job to Runner: Foo for queue container-host,self-hosted assigned to Runner Name:Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef Labels:container-host,self-hosted
[Dynamic Matix / Foo] Running: Set up job
|Current runner version: '3.5.0'
|Runner name: 'Agent-0765dc15-730c-4a71-8f77-ddd0a86c67ef'
|Machine name: 'DESKTOP-3SVG86B'
|Prepare workflow directory
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|Prepare all required actions
[Dynamic Matix / Foo] Succeeded: Set up job
[Dynamic Matix / Foo] Running: Initialize containers
|##[group]Checking docker version
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.APIVersion}}'
|'1.41'
|Docker daemon API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Client.APIVersion}}'
|'1.41'
|Docker client API version: '1.41'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Os}}'
|'linux'
|Docker server Os: 'linux'
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE version --format '{{.Server.Arch}}'
|'amd64'
|Docker server Arch: 'amd64'
|##[endgroup]
|##[group]Clean up resources from previous jobs
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --quiet --no-trunc --filter "label=df4e78"
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network prune --force --filter "label=df4e78"
|##[endgroup]
|##[group]Create local container network
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network create --label df4e78 github_network_3d2b0974eef4446a990d46efa019e278
|c09024b06d6340ee45d2f93e5a077ccedfd2ce9194d15bc86d5085e5c3edf65a
|##[endgroup]
|##[group]Starting job container
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE pull catthehacker/ubuntu:act-latest
|act-latest: Pulling from catthehacker/ubuntu
|Digest: sha256:b760bdffae1d8bc4822f0b429ba720d56556d94cc03a2b0e2f2062b67e832e19
|Status: Image is up to date for catthehacker/ubuntu:act-latest
|docker.io/catthehacker/ubuntu:act-latest
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE create --name b2e732b603a74bc7a80f7d99552f6103_catthehackerubuntuactlatest_081e5c --label df4e78 --workdir /__w/Unknown/Unknown --network github_network_3d2b0974eef4446a990d46efa019e278  -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock"...
|4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE start 4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE ps --all --filter id=4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
|4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d Up Less than a second
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE inspect --format "{{range .Config.Env}}{{println .}}{{end}}" 4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|HOME=/github/home
|GITHUB_ACTIONS=true
|CI=true
|PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|DEBIAN_FRONTEND=noninteractive
|##[endgroup]
|##[group]Waiting for all services to be ready
|##[endgroup]
[Dynamic Matix / Foo] Succeeded: Initialize containers
[Dynamic Matix / Foo] Running: foo b
|##[group]Run echo 'Matrix "b" JSON: {
|echo 'Matrix "b" JSON: {
|  "package": "b"
|} {"package": ["a", "b"]}'
|shell: pwsh -command ". '{0}'"
|##[endgroup]
|Matrix "b" JSON: {
|  "package": "b"
|} {"package": ["a", "b"]}
[Dynamic Matix / Foo] Succeeded: foo b
[Dynamic Matix / Foo] Running: Stop containers
|Stop and remove container: b2e732b603a74bc7a80f7d99552f6103_catthehackerubuntuactlatest_081e5c
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE rm --force 4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|4bdd5590d85a9b19b231774c5d972748527805437db1fca574fde9067320730d
|Remove container network: github_network_3d2b0974eef4446a990d46efa019e278
|##[command]C:\Program Files\Docker\Docker\resources\bin\docker.EXE network rm github_network_3d2b0974eef4446a990d46efa019e278
|github_network_3d2b0974eef4446a990d46efa019e278
[Dynamic Matix / Foo] Succeeded: Stop containers
[Dynamic Matix / Foo] Running: Complete job
|Cleaning up orphan processes
[Dynamic Matix / Foo] Succeeded: Complete job
[Dynamic Matix / Foo] Job Completed with Status: Succeeded
Workflow 1 finished with status Success
All Workflows finished successfully
Stopped Server
Stopped Runner

@github-actions github-actions bot removed the stale label Jan 15, 2022
@Meroje
Copy link

Meroje commented Jan 21, 2022

This was fixed by #700 then broken by #763, using 0.2.24 works.

@ChristopherHX
Copy link
Contributor

I opened a Pull Request #964 to provide even better dynamic matrix support as in act 0.2.24.

Including 3 tests to enshure that this feature doesn't break again without notice.

@ilons
Copy link

ilons commented Feb 10, 2022

To add some more details on things that does not work related to dynamic matrix.

  1. Un-marshalling property of matrix:
jobs:
  job1:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}
    steps:
      - name: get parent directory and set matrix
        id: set-matrix
        run: |
          echo "::set-output name=matrix::[\"a\",\"b\"]"

  job2:
    needs: [job1]
    runs-on: ubuntu-latest
    strategy:
      matrix:
        dirs: ${{fromJson(needs.job1.outputs.matrix)}}
    steps:
      - run: |
          echo "${{ matrix.dirs }}"

Gives:

FATA[0000] yaml: unmarshal errors:
  line 25: cannot unmarshal !!str `${{from...` into []interface {}

  1. Dynamic matrix
jobs:
  job1:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}
    steps:
      - name: get parent directory and set matrix
        id: set-matrix
        run: |
          echo "::set-output name=matrix::{\"dirs\":[\"a\",\"b\"]}"

  job2:
    needs: [job1]
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{fromJson(needs.job1.outputs.matrix)}}
    steps:
      - run: |
          echo "${{ matrix.dirs }}"

Simply prints empty line.


Both of those cases executes as 2 separate jobs on GHA, printing a and b.

@MostefaKamalLala
Copy link

MostefaKamalLala commented Feb 10, 2022

I just installed nektos/act and I experienced the same error. I have a workflow similar to @ilons 's last post's first example.

Job 1 sets up the matrix. Job 2 uses the output of Job 1 wrapped in fromJson function in the matrix definition.

Error: yaml: unmarshal errors:
  line 55: cannot unmarshal !!str `${{ fro...` into []interface {}
  line 56: cannot unmarshal !!str `${{ fro...` into []interface {}
  line 57: cannot unmarshal !!str `${{ fro...` into []interface {}

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants