flowpactworkflow contracts
Rules

FP107 · optional-forwarded-to-required

A required input of a callee is fed from an optional input that has no default.

CodeNameCategoryDefault severity
FP107optional-forwarded-to-requiredInputs🟡 warning

Why it matters

The call looks complete, so GitHub never complains about the required input, but when the outer caller omits the optional value the callee receives an empty string. The "required" guarantee is lost one level up.

How to fix

Make the outer input required too, give it a default, or add a fallback: $\{\{ inputs.x || 'value' \}\}.

Example

# pipeline.yml
inputs:
  config: { type: string, required: false }
jobs:
  test:
    uses: ./.github/workflows/test.yml
    with:
      config: ${{ inputs.config }}   # test.yml: config is required

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:
  FP107: off
  # or: optional-forwarded-to-required: error

Explain it in the terminal:

flowpact explain FP107

On this page