flowpact
Rules

FP302 · output-ref-without-needs

`needs.<job>` is read where the `needs` context does not contain `<job>`.

CodeNameCategoryDefault severity
FP302output-ref-without-needsOutputs🔴 error

Why it matters

The needs context contains the jobs listed under needs:. Only the job's own if: also sees the jobs it depends on indirectly (through one of its needs); in steps, env, with:, name and the matrix their values are empty. A job that does not depend on \<job\> at all may also run before it.

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