Skip to content
Latchkey

GitHub Actions matrix produced duplicate combinations

When matrix include adds entries that collide with the base expansion, or a dynamic matrix repeats values, the strategy produces duplicate combinations - either rejected or run redundantly.

What this error means

The matrix runs the same combination twice, or validation flags duplicate combinations.

github-actions
Error: Matrix produced duplicate combinations.
The combination { os: ubuntu-latest, node: 20 } appears more than once.

Common causes

include re-adds an existing combination

A matrix.include entry recreates a combination already in the base expansion.

Dynamic matrix with repeated values

A fromJSON array contains duplicate objects.

How to fix it

De-duplicate the matrix

  1. Use include only to add new combinations or extra keys, not to repeat existing ones.
  2. Deduplicate the JSON feeding a dynamic matrix before fromJSON.
.github/workflows/ci.yml
strategy:
  matrix:
    os: [ubuntu-latest]
    node: [18, 20]
    include:
      - os: macos-latest
        node: 20

How to prevent it

  • Understand include semantics: it extends or adds, it does not silently overwrite.
  • Validate dynamic matrix JSON for uniqueness in the generating step.

Frequently asked questions

What causes ""matrix produced duplicate combinations""?
A matrix.include entry recreates a combination already in the base expansion.
How do I fix "matrix produced duplicate combinations"?
De-duplicate the matrix

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card