Skip to Content
flowpact

FP403 · dynamic-matrix-unverified

The matrix is computed at runtime, so flowpact cannot check that every combination defines the keys it reads.

CodeNameCategoryDefault severityReported by
FP403dynamic-matrix-unverifiedMatrix🔵 infolint, check, the action, the editor

What you see

In the dynamic-matrix fixture:

●  INFO  FP403 dynamic-matrix-unverified
  jobs.dynamic has a runtime-computed matrix; reads of matrix.os, matrix.config cannot be verified
  ▶ .github/workflows/matrix.yml:17:7

Why it matters

Dynamic matrices (fromJSON(...)) hide the same empty-value failure mode as static ones, but no tool can see it.

How to fix

Declare the keys in the config (matrixShapes: { "<workflow>#<job>": { keys: [os, config] } }) so flowpact can verify reads, prefer a static matrix, or validate the generated JSON in the job that produces it.

Example

jobs:
  test:
    needs: setup
    strategy:
      matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
    runs-on: ${{ matrix.os }}

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

.github/workflows/matrix.yml
# flowpact: ignore[FP403] why it is acceptable here
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}

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

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP403
    target: ".github/workflows/matrix.yml#jobs.dynamic"
    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 == "FP403") | .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:
  FP403: off
  # or: dynamic-matrix-unverified: error

Explain it in the terminal:

flowpact explain FP403

On this page