GitHub Actions format() Error - Placeholder Out of Range or Bad Braces
By Daniel Zoghalchali·Latchkey
A format() call references a placeholder index that has no matching argument, or contains literal { / } that were not escaped, so the expression fails to evaluate.
What this error means
The workflow fails to compile or a step errors when evaluating a format() expression, complaining about the format string or an index outside the supplied arguments.
.github/workflows/ci.yml
# {2} has no third argument (only {0} and {1} are supplied)name:${{ format('{0}-{1}-{2}', github.ref_name, github.sha) }}
Common causes
Placeholder index beyond the arguments
format() uses zero-based indices. {2} requires a third argument; supplying only two makes the index out of range.
Unescaped literal braces
A literal { or } in the format string is interpreted as a placeholder. To emit a real brace you must double it as {{ or }}.