flowpact
Rules

FP303 · unused-output

A job output, or an output of an internal reusable workflow or action, is declared but nothing reads it.

CodeNameCategoryDefault severity
FP303unused-outputOutputs🟡 warning

Why it matters

Unused outputs suggest a broken hand-off: either the consumer reads a different name, or the output is dead code.

How to fix

Remove the output, or make the intended consumer read it.

Scope

Job outputs are always judged: only the jobs and workflow outputs of the same workflow can read them. Outputs of a reusable workflow or an action are judged only for an internal unit that this repository uses. Published units are not reported, because their consumers live in other repositories: reusable workflows (except files starting with _), the root action.yml, or exactly the units listed in impact.publish when it is set. Actions in subdirectories (owner/repo/restore@v1) count as internal unless impact.publish lists them. Reading the whole object (toJSON(needs.build.outputs), needs.build.outputs[matrix.key], toJSON(steps)) counts as reading every output. Not reported in generated files, which are not edited by hand.

Example

build:
  outputs:
    version: ${{ steps.meta.outputs.version }}
    digest: ${{ steps.push.outputs.digest }}   # nothing reads needs.build.outputs.digest
deploy:
  needs: build
  steps:
    - 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:
  FP303: off
  # or: unused-output: error

Explain it in the terminal:

flowpact explain FP303

On this page