GitHub Actions "Invalid workflow file: error in your yaml syntax"
GitHub could not parse your workflow as YAML, so the run never starts. The annotation names the line of the first parse failure.
What this error means
The Actions tab shows "Invalid workflow file" with "You have an error in your yaml syntax on line N". No jobs execute because the file never compiled.
github-actions
Invalid workflow file: .github/workflows/ci.yml#L7
You have an error in your yaml syntax on line 7Common causes
A tab character used for indentation
YAML forbids tabs for indentation. A pasted tab anywhere in the indent makes the parser reject the file.
Inconsistent indentation depth
Mixing two-space and four-space indentation, or mis-aligning a nested key, breaks the YAML block structure.
How to fix it
Replace tabs with spaces and re-check indentation
- Use spaces only, two per nesting level.
- Show invisible characters in your editor to spot stray tabs.
- Lint with a YAML tool before pushing.
Terminal
yamllint .github/workflows/ci.ymlHow to prevent it
- Add an .editorconfig that enforces spaces for *.yml files.
- Run actionlint as a pre-commit hook.
Related guides
GitHub Actions "mapping values are not allowed in this context"Fix the GitHub Actions YAML error "mapping values are not allowed in this context" caused by a stray colon or…
GitHub Actions YAML "did not find expected key"Fix the GitHub Actions YAML error "did not find expected key" caused by broken indentation that leaves the pa…
GitHub Actions "every step must define a uses or run key"Fix the GitHub Actions "every step must define a uses or run key" validation error caused by a step that has…