FP401 · empty-binding-for-matrix-combo
An input passed under `with:` is empty for some matrix combinations because a matrix key is missing there.
| Code | Name | Category | Default severity | Reported by |
|---|---|---|---|---|
FP401 | empty-binding-for-matrix-combo | Matrix | 🔴 error | lint, 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:19Why 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):
# flowpact: ignore[FP401] why it is acceptable here
config: ${{ matrix.config }}In the config, with an override, which can expire:
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 # optionaltarget 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:
rules:
FP401: off
# or: empty-binding-for-matrix-combo: errorExplain it in the terminal:
flowpact explain FP401Related
FP402matrix-key-missing-in-combo: An expression reads a matrix key that is only defined in some combinations.FP404undefined-matrix-key: An expression reads a matrix key that no combination defines (or the job has no matrix).FP105optional-input-no-default-in-condition: An optional input that is '' when omitted (no default, ordefault: '') decides anif:by its truthiness.- How matrices are expanded