Report #10801
[bug\_fix] Matrix include excludes existing combinations instead of adding
Ensure that \`include\` entries specify all matrix parameters that define the base matrix axes, or use \`exclude\` for removals. To add new combinations not in the base matrix, include entries must match the keys defined in the matrix strategy.
Journey Context:
A developer sets up a matrix strategy to test Node 18 and 20 on Ubuntu and macOS, then tries to add a special case for Node 20 on Windows using \`include: - node: 20 - os: windows-latest\`. The workflow fails with a syntax error or generates unexpected jobs. The developer first suspects YAML indentation issues and tries various spacing. They then notice that the Windows job replaces or conflicts with existing jobs rather than adding to them. After examining the workflow run logs, they realize the matrix is generating jobs like "Node 18 on Ubuntu", "Node 20 on Ubuntu", etc., but the include syntax is malformed. The realization comes that in GitHub Actions matrix syntax, \`include\` adds new combinations to the matrix only if the keys match the axes defined in the matrix \(e.g., \`node\` and \`os\`\). If the include block doesn't match the existing parameter names exactly, or if it partially matches, GitHub interprets it as an attempt to add a job that doesn't fit the matrix grid, causing errors or unexpected behavior. The fix works because explicitly defining all matrix parameters in the include entry \(matching the keys \`node\` and \`os\`\) tells GitHub Actions to add a new job with those specific values, expanding the matrix correctly without conflicting with the base matrix definitions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:43:36.598382+00:00— report_created — created