Fixing GitHub Actions 'unexpected symbol' errors in ${{ }} expressions

A GitHub Actions 'unexpected symbol' error appears when the expression parser encounters a character it has no rule for, which stops the workflow file from being accepted. The workflow never runs, and GitHub reports it as an invalid file pointing to the YAML line, with the offending token and its position inside the expression. The most common cause is a double-quoted string literal, since the expression language only accepts single quotes. Other causes include unsupported operators such as arithmetic, ternaries or single ampersands, mismatched or stray braces, and literal text placed directly beside an expression. The usual fixes are switching to single quotes, using functions like format() or contains(), and moving complex logic into a run step.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in