flowpactworkflow contracts
Rules

FP302 · output-ref-without-needs

`needs.<job>` is read in a job that does not list `<job>` under `needs:`.

CodeNameCategoryDefault severity
FP302output-ref-without-needsOutputs🔴 error

Why it matters

The needs context only contains direct dependencies. Without the edge, the value is empty and the jobs may also run in parallel, so even a fixed name would race.

How to fix

Add the job to needs: (it is fine to list transitive dependencies explicitly).

Example

deploy:
  needs: test
  run: deploy ${{ needs.build.outputs.version }}

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:
  FP302: off
  # or: output-ref-without-needs: error

Explain it in the terminal:

flowpact explain FP302

On this page