Skip to content
Latchkey

GitHub Actions "Unrecognized function" in an expression

An expression called a function that Actions does not provide. Only a fixed set of built-in functions exists.

What this error means

The workflow is rejected with "Unrecognized function: '<name>'" at the expression that called it.

github-actions
The workflow is not valid. .github/workflows/ci.yml (Line: 8): Unrecognized function: 'lower'. Located at position 1 within expression: lower(github.ref_name)

Common causes

A function that does not exist

There is no lower, upper, or trim function. The available functions are contains, startsWith, endsWith, format, join, toJSON, fromJSON, hashFiles, and the status checks.

Misspelled built-in

fromJson instead of fromJSON, or starts-with instead of startsWith, is not recognized.

How to fix it

Use a supported function or shell logic

  1. Replace unsupported calls with a built-in function.
  2. For string transforms not available in expressions, do them in a run step shell.
.github/workflows/ci.yml
- run: echo "ref=${REF,,}"
  env:
    REF: ${{ github.ref_name }}

How to prevent it

  • Reference the expressions function list before using one.
  • Run actionlint to flag unknown functions.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →