GitHub Actions "You have an error in your YAML syntax" (tab characters)
By Kaveh Alemi·Latchkey
YAML does not allow tab characters for indentation. A single tab pasted into a workflow file produces a parse error that points at a line and column.
What this error means
The workflow is rejected with a YAML syntax error at a specific line, and the offending indentation turns out to be a tab rather than spaces.
github-actions
Invalid workflow file: .github/workflows/ci.yml
You have an error in your yaml syntax on line 9
Common causes
Tab used for indentation
An editor inserted a literal tab; YAML only permits spaces for indentation.
Mixed tabs and spaces
Copy-paste from another file can introduce tabs that break alignment.
How to fix it
Replace tabs with spaces
- Show whitespace in your editor and convert tabs to two spaces.
- Set the editor to insert spaces for .yml/.yaml files.
- Re-indent the flagged line consistently.
.editorconfig
# .editorconfig
[*.{yml,yaml}]
indent_style = space
indent_size = 2
How to prevent it
- Add an .editorconfig that enforces spaces for YAML.
- Run a YAML linter in pre-commit to catch tabs.
Frequently asked questions
What causes "YAML syntax error (tabs)"?
An editor inserted a literal tab; YAML only permits spaces for indentation.
How do I fix YAML syntax error (tabs)?
Replace tabs with spaces
Related guides
References