flowpactworkflow contracts
Rules

FP105 · optional-input-no-default-in-condition

An optional input without a default decides an `if:` condition.

CodeNameCategoryDefault severity
FP105optional-input-no-default-in-conditionInputs🟡 warning

Why it matters

When a caller omits an optional input that has no default, GitHub substitutes an empty string. Conditions then take the "false" branch silently, so jobs or steps are skipped and the run is still green.

How to fix

Give the input an explicit default, make it required: true, or compare explicitly (inputs.x != '').

Example

inputs:
  variant: { type: string, required: false }
...
if: inputs.variant == 'gpu'

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:
  FP105: off
  # or: optional-input-no-default-in-condition: error

Explain it in the terminal:

flowpact explain FP105

On this page