FP203 · unused-secret
A `workflow_call` secret is declared but never read.
| Code | Name | Category | Default severity | Reported by |
|---|---|---|---|---|
FP203 | unused-secret | Secrets | 🟡 warning | lint, check, the action, the editor |
What you see
In the deep-nesting fixture:
▲ WARN FP203 unused-secret
Secret "signing-key" of .github/workflows/package.yml is never read
▶ .github/workflows/package.yml:17:7Why it matters
Every caller must still wire the secret, widening its exposure for nothing.
How to fix
Remove the declaration and the callers’ secrets: bindings, or use the secret where intended.
Example
on:
workflow_call:
secrets:
npm_token:
required: true # nothing below reads it
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm testScope
A secret counts as read when the workflow reads it by name or reads the whole secrets context (toJSON(secrets), secrets.*, secrets[inputs.name]), or hands every secret through secrets: inherit to a callee that reads it by name or reads every secret it gets, itself or further down. An expression that does not parse, and a callee flowpact cannot read (a remote workflow, or a local one that is missing or not reusable), may read any secret, so they count as reading every secret. Not reported in generated files, which are not edited by hand.
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 does not fail the build.
On its line, with an ignore comment alone on the line above it (the
editor's quick fix adds it there) or at the end of the line, after any other comment such as a version
(# v4.3.0 # flowpact: ignore[FP203] why):
# flowpact: ignore[FP203] why it is acceptable here
signing-key:In the config, with an override, which can expire:
overrides:
- rule: FP203
target: ".github/workflows/package.yml#secrets.signing-key"
reason: Why it is acceptable here, at least 10 characters.
expires: YYYY-MM-DD # optionaltarget is the symbol the finding is about; to list them:
flowpact lint --format json | jq -r '.findings[] | select(.code == "FP203") | .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:
rules:
FP203: off
# or: unused-secret: errorExplain it in the terminal:
flowpact explain FP203Related
FP204secrets-inherit:secrets: inherithands every repository secret to the callee; flowpact lists what is actually needed.