Skip to Content
flowpact

FP202 · unknown-secret

A caller passes a secret the reusable workflow does not declare.

CodeNameCategoryDefault severityReported by
FP202unknown-secretSecrets🔴 errorlint, check, the action, the editor

Why it matters

GitHub rejects the call ("Invalid secret … is not defined in the referenced workflow").

How to fix

Declare the secret under on.workflow_call.secrets in the callee, fix the name, or remove it.

Example

jobs:
  deploy:
    uses: ./.github/workflows/deploy.yml   # declares the secret deploy-token
    secrets:
      deploy_token: ${{ secrets.DEPLOY_TOKEN }}

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[FP202] why):

.github/workflows/ci.yml
# flowpact: ignore[FP202] why it is acceptable here
<the line of the finding>

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

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP202
    target: <the finding's symbol>
    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 == "FP202") | .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:
  FP202: off
  # or: unknown-secret: error

Explain it in the terminal:

flowpact explain FP202
  • FP201 missing-required-secret: A reusable workflow is called without one of its required secrets.
  • FP205 undeclared-secret-ref: A reusable workflow reads a secret it does not declare, and some caller does not use secrets: inherit.
  • Remote interfaces

On this page