Convert JSON text into a matrix object.
Section: Contexts and expressions
Build a matrix from JSON
yaml
yaml
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}Explanation
`fromJson()` is useful when one job computes dynamic matrix values for another.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Contexts and expressions
Use a context value in a step
Read metadata from the current workflow run.
Use repository or organization variables
Read configuration values from the `vars` context.
Promote a step output to a job output
Pass values between jobs through `needs`.
Set an environment variable for later steps
Append to `GITHUB_ENV` to persist a variable in the current job.