flowpactworkflow contracts
Rules

FP501 · undefined-env-ref

`${{ env.NAME }}` reads a variable that is not defined at workflow, job or step level, nor written to `$GITHUB_ENV` earlier.

CodeNameCategoryDefault severity
FP501undefined-env-refEnv & expressions🟡 warning

Why it matters

The env context only contains variables set by the workflow itself — not runner defaults like GITHUB_SHA. Reads of anything else evaluate to an empty string.

How to fix

Define the variable under env:, write it to $GITHUB_ENV in an earlier step, or use the matching context (e.g. github.sha).

Example

run: echo ${{ env.GITHUB_SHA }}

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:
  FP501: off
  # or: undefined-env-ref: error

Explain it in the terminal:

flowpact explain FP501

On this page