flowpact
Rules

FP401 · empty-binding-for-matrix-combo

An input passed under `with:` is empty for some matrix combinations because a matrix key is missing there.

CodeNameCategoryDefault severity
FP401empty-binding-for-matrix-comboMatrix🔴 error

Why it matters

GitHub evaluates a missing matrix key to an empty string — no error, no warning. The affected matrix leg runs with an empty input, so the callee may skip its real work (e.g. a test configuration) while the run stays green.

How to fix

Define the key in every combination (add it to the include entry or a matrix dimension), or add an explicit fallback: $\{\{ matrix.key || 'default' \}\}. Reported as an error when the input is required (or the callee is not in the repository) or when its default is empty (none, or default: '') and an if: in the callee reads it, and as a warning when the empty value replaces a non-empty default. Not reported for other optional inputs (an empty default that no condition reads, or reads only through a fallback such as inputs.x || 'all'): the callee handles the empty value like an omitted input.

Example

strategy:
  matrix:
    include:
      - name: linux
        config: ci-linux.json
      - name: windows        # no "config" → empty input
uses: ./.github/workflows/run-tests.yml   # declares config: { required: true }
with:
  config: ${{ matrix.config }}

Configure

Change the severity (or turn the rule off) in .github/flowpact/flowpact.config.yml, by code or by name:

.github/flowpact/flowpact.config.yml
rules:
  FP401: off
  # or: empty-binding-for-matrix-combo: error

Explain it in the terminal:

flowpact explain FP401

On this page