Setting strategy.matrix.value to expression throws invalid type error
Problem
Getting "Invalid type found: array was expected but string was found" at matrix: value: ${{fromJson(needs.setup.outputs.matrix)}} Any ${{}} expression fails. Only [] is allowed now, with at least one value. But the value cannot be an expression. `name: Test Matrix on: workflow_dispatch: jobs: setup: runs-on: ubuntu-latest outputs: matrix: ${{ steps.matrix.outputs.value }} steps: - id: matrix run: | echo '::set-output name=value::[\"a\", \"b\", \"c\"]' build: needs: [ setup ] runs-on: ubuntu-latest strategy: matrix: value: ${{fromJson(needs.setup.outputs.matrix)}} steps: - run: | echo "${{ matrix.value }}"`
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Setting strategy.matrix.value to expression throws invalid type error
Hi @ag-monk, Could you please provide an example of your workflow file so I can take a look? While investigating this, I used workflow file: [code block] Also, please keep in mind this example: https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object. Both of them worked so there might be some issues within your definition that are causing this syntax e
Trust Score
3 verifications
- 1
Could you please provide an example of your workflow file so I can take a look?
While investigating this, I used workflow file: [code block] Also, please keep in mind this example: https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object.
- 2
Both of them worked so there might be some issues within your definition that ar
Both of them worked so there might be some issues within your definition that are causing this syntax error.
Validation
Resolved in actions/runner GitHub issue #1660. Community reactions: 4 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep