Skip to Content
flowpact

FP804 · orphan-contract

A contract file exists for a workflow or action that no longer exists.

CodeNameCategoryDefault severityReported by
FP804orphan-contractContracts🔴 errorcheck, the action's mode: check, the editor with contracts

What you see

In the contracts-drift fixture:

✖  ERROR  FP804 orphan-contract
  Contract .github/flowpact/contracts/workflows/nightly.contract.yml describes .github/workflows/nightly.yml which no longer exists
  ▶ .github/flowpact/contracts/workflows/nightly.contract.yml:1:1

Why it matters

If the workflow was removed or renamed, anything still calling it (including other repositories) breaks — the stale contract is the last record of that interface.

How to fix

Confirm nothing depends on the removed workflow, then run flowpact generate to delete the contract.

Example

# .github/workflows/nightly.yml was deleted; its contract is still there
# .github/flowpact/contracts/workflows/nightly.contract.yaml
kind: workflow
path: .github/workflows/nightly.yml

Accept one finding

When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes (overrides):

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP804
    target: ".github/workflows/nightly.yml"
    reason: Why it is acceptable here, at least 10 characters.
    expires: YYYY-MM-DD   # optional

target is the symbol the finding is about; to list them:

flowpact lint --format json | jq -r '.findings[] | select(.code == "FP804") | .symbol'

* matches within a path segment and ** across segments, so one entry accepts every finding whose symbol matches: target: '**#inputs.app-id' is that input in every workflow and action.

Change the severity

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:
  FP804: off
  # or: orphan-contract: error

Explain it in the terminal:

flowpact explain FP804
  • FP801 contract-missing: A workflow or local action has no contract in .github/flowpact/ (check mode).
  • Contracts

On this page