Skip to Content
flowpact

FP502 · expression-parse-error

A `${{ }}` expression (or an `if:` condition) cannot be parsed.

CodeNameCategoryDefault severityReported by
FP502expression-parse-errorEnv & expressions🔴 errorlint, check, the action, the editor

What you see

In the broken fixture:

✖  ERROR  FP502 expression-parse-error
  Invalid expression "inputs.mode = 'release'": Unexpected symbol: '='
  ▶ .github/workflows/expressions.yml:10:25

Why it matters

GitHub rejects the workflow when it is triggered, or fails the step that contains the expression.

How to fix

Fix the syntax: strings use single quotes, == for equality, and every ${{ needs a closing }}.

Example

if: ${{ inputs.mode = "release" }}

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

.github/workflows/expressions.yml
# flowpact: ignore[FP502] why it is acceptable here
if: ${{ inputs.mode = 'release' }}

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

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP502
    file: ".github/workflows/expressions.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 == "FP502") | .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:
  FP502: off
  # or: expression-parse-error: error

Explain it in the terminal:

flowpact explain FP502
  • FP503 schema-violation: The file does not match GitHub’s workflow / action schema (validated with GitHub’s own parser).
  • FP505 context-not-available: An expression uses a context or function that GitHub does not allow in that field (e.g. env in a reusable workflow call’s with:).

On this page