Skip to Content
flowpact

FP204 · secrets-inherit

`secrets: inherit` hands every repository secret to the callee; flowpact lists what is actually needed.

CodeNameCategoryDefault severityReported by
FP204secrets-inheritSecrets🔵 infolint, check, the action, the editor

What you see

In the deep-nesting fixture:

●  INFO  FP204 secrets-inherit
  jobs.build inherits all secrets; .github/workflows/build.yml and its callees read REGISTRY_TOKEN
  ▶ .github/workflows/pipeline.yml:26:5

Why it matters

Inherit makes the secret flow invisible: nobody can tell from the caller which secrets reach which job, and every nested workflow gets all of them.

How to fix

Replace secrets: inherit with an explicit secrets: mapping of the secrets listed in the message.

Example

uses: ./.github/workflows/deploy.yml
secrets: inherit

Scope

Not reported when the callee, or a callee it hands every secret to, reads the whole secrets context (toJSON(secrets), secrets.*, secrets[inputs.name]), has an expression that does not parse, or hands every secret on to a workflow flowpact cannot read (a remote workflow, or a local one that is missing or not reusable): it then reads, or may read, every secret the caller has, which no explicit mapping can list. 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[FP204] why):

.github/workflows/pipeline.yml
# flowpact: ignore[FP204] why it is acceptable here
secrets: inherit

In the config, with an override, which can expire:

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP204
    target: ".github/workflows/pipeline.yml#jobs.build.secrets"
    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 == "FP204") | .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:
  FP204: off
  # or: secrets-inherit: error

Explain it in the terminal:

flowpact explain FP204
  • FP203 unused-secret: A workflow_call secret is declared but never read.
  • FP205 undeclared-secret-ref: A reusable workflow reads a secret it does not declare, and some caller does not use secrets: inherit.

On this page