FG
☁️ Cloud & DevOpsMicrosoft

Setting strategy.matrix.value to expression throws invalid type error

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score77%
77%

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

Canonical Fix
High Confidence Fix
74% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: Setting strategy.matrix.value to expression throws invalid type error

Low Risk

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

74

Trust Score

3 verifications

100% success
  1. 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. 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

Worked: 3
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

github-actionsci-cdrunnerbug