GitHub Actions "found character '\t' that cannot start any token" in CI
YAML disallows tab characters for indentation. A single tab anywhere in the structure makes the scanner reject the file before the workflow runs.
What this error means
The run fails with "Invalid workflow file" and "found character that cannot start any token" pointing at a line that was indented with a tab.
GitHub Actions
Invalid workflow file: .github/workflows/ci.yml
(Line: 11, Col: 1): while scanning for the next token
found character '\t' that cannot start any tokenCommon causes
An editor inserted a tab for indentation
A tab key press, or an editor not set to expand tabs, put a literal tab where YAML requires spaces.
A paste mixed tabs and spaces
Copied content carried tabs that are invisible next to space-indented lines.
How to fix it
Replace all tabs with spaces
- Show whitespace in your editor so tabs are visible.
- Convert tabs to two spaces throughout the file.
- Configure the editor to expand tabs for YAML.
Terminal
# show tabs, then expand them in-place
grep -nP '\t' .github/workflows/ci.yml
sed -i 's/\t/ /g' .github/workflows/ci.ymlEnforce spaces with an editorconfig
Add an .editorconfig rule so YAML files always use spaces.
.editorconfig
[*.{yml,yaml}]
indent_style = space
indent_size = 2How to prevent it
- Set the editor to insert spaces, never tabs, in YAML.
- Add an
.editorconfigfor the repo. - Lint workflows so a stray tab fails locally.
Related guides
GitHub Actions "mapping values are not allowed in this context" in CIFix GitHub Actions "while scanning ... mapping values are not allowed in this context" in CI - a stray colon…
GitHub Actions "could not find expected ':'" YAML error in CIFix GitHub Actions "could not find expected ':'" in CI - the YAML scanner reached the end of a key without th…
GitHub Actions "Unexpected value 'runs-on'" in CIFix GitHub Actions "Unexpected value 'runs-on'" in CI - `runs-on` was placed outside a job, where the workflo…