Job 'discover' outputs a JSON array of package names as 'packages'. Job 'build' should matrix over that list. Which pattern is correct?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Dynamic matrices use fromJSON() on a prior job's output string that contains a JSON array or object, with needs linking the jobs.
Full explanation below image
Full Explanation
A preparatory job can compute a JSON array, export it as a job output, and a dependent job can set strategy.matrix to fromJSON(needs.discover.outputs.packages). The discover job must finish first via needs. Secrets are the wrong store for package name lists. Artifacts can carry files but still require a job to read them into outputs or generate the matrix. Dynamic matrices are a supported advanced pattern for monorepos and selective builds. Ensure the JSON is valid and size stays within output limits.