Skip to Content
flowpact

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 severityReported by
FP401empty-binding-for-matrix-comboMatrix🔴 errorlint, check, the action, the editor

What you see

In the incident-matrix fixture:

✖  ERROR  FP401 empty-binding-for-matrix-combo
  Input "config" for .github/workflows/run-suite.yml is empty in 1 of 3 matrix combinations — matrix.config is not defined there
  ▶ .github/workflows/tests.yml:23:19

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' }}.

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 }}

Scope

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.

Accept one finding

When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build.

On its line, with an ignore comment alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (# v4.3.0 # flowpact: ignore[FP401] why):

.github/workflows/tests.yml
# flowpact: ignore[FP401] why it is acceptable here
config: ${{ matrix.config }}

In the config, with an override, which can expire:

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP401
    target: ".github/workflows/run-suite.yml#inputs.config"
    reason: Why it is acceptable here, at least 10 characters.
    expires: YYYY-MM-DD   # optional

target is the symbol the finding is about; to list them:

flowpact lint --format json | jq -r '.findings[] | select(.code == "FP401") | .symbol'

* matches within a path segment and ** across segments, so one entry accepts every finding whose symbol matches: target: '**#inputs.app-id' is that input in every workflow and action.

Change the severity

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
  • FP402 matrix-key-missing-in-combo: An expression reads a matrix key that is only defined in some combinations.
  • FP404 undefined-matrix-key: An expression reads a matrix key that no combination defines (or the job has no matrix).
  • FP105 optional-input-no-default-in-condition: An optional input that is '' when omitted (no default, or default: '') decides an if: by its truthiness.
  • How matrices are expanded

On this page