dynamic matrix
A matrix whose values are computed by an earlier job and read in with fromJSON, instead of written into the file.
In more detail
An earlier job computes the values, publishes them as a job output, and the next job expands over them. The same generator can return a short list on pull requests and the full list on the default branch to save runner minutes.
Example
list=$(jq -Rsc 'split("\n") - [""]' versions.txt)
echo "list=$list" >> "$GITHUB_OUTPUT"Related terms
- fromJSON — A workflow expression function that turns a JSON string into a real value, such as a list for a matrix.
- job output — A small string a job publishes in its outputs block so that jobs which need it can read it.
- jq — A command-line tool that reads, filters and reshapes JSON data.
- strategy matrix — A job setting that expands one job description into one job for every combination of the listed values.
Taught in
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines