fromJSON
A workflow expression function that turns a JSON string into a real value, such as a list for a matrix.
In more detail
It is evaluated by GitHub before any shell runs. That is why it can build a matrix from a job output, which a shell variable never could.
Example
version: ${{ fromJSON(needs.versions.outputs.list) }}Related terms
- dynamic matrix — A matrix whose values are computed by an earlier job and read in with fromJSON, instead of written into the file.
- workflow expression — Text inside ${{ and }} in a workflow file that GitHub evaluates before a step runs, such as ${{ github.sha }}.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
Taught in
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines