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
- Replace unsupported calls with a built-in function.
- 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
GitHub Actions "Unrecognized named-value: secrets"Fix the GitHub Actions expression error "Unrecognized named-value: secrets" caused by using a context where i…
GitHub Actions "Context access might be invalid" (actionlint)Fix the actionlint warning "Context access might be invalid" for GitHub Actions caused by referencing a secre…
GitHub Actions fromJSON parse errorFix the GitHub Actions fromJSON parse error caused by passing a non-JSON or malformed string into the fromJSO…