A matrix defines os: [ubuntu-latest, windows-latest] and node: [18, 20]. You need to add one extra combination of os: macos-latest with node: 20 without expanding macos across all node versions. Which key adds only that combination?
Select an answer to reveal the explanation.
Short Explanation and Infographic
include can add brand-new matrix combinations that were not in the cartesian product. exclude only removes combinations; extend is not a matrix key in GitHub Actions.
Full explanation below image
Full Explanation
strategy.matrix builds a cartesian product of the listed axes. To inject an additional combination without multiplying every value of one axis by every value of another, use include with an object that specifies the full combination (for example os: macos-latest, node: 20). That adds exactly one job. exclude removes combinations from the product; it cannot add macos. There is no matrix key named extend. with is used for action inputs, not matrix shape. include can also refine existing combinations by matching axes and adding extra variables. For GH-200, know the difference: include adds or augments; exclude subtracts; fail-fast and max-parallel control execution behavior of the expanded jobs.