Skip to content
Latchkey

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 token

Common 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

  1. Show whitespace in your editor so tabs are visible.
  2. Convert tabs to two spaces throughout the file.
  3. 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.yml

Enforce spaces with an editorconfig

Add an .editorconfig rule so YAML files always use spaces.

.editorconfig
[*.{yml,yaml}]
indent_style = space
indent_size = 2

How to prevent it

  • Set the editor to insert spaces, never tabs, in YAML.
  • Add an .editorconfig for the repo.
  • Lint workflows so a stray tab fails locally.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →