GitHub Actions "Invalid workflow file" - Fix YAML Syntax Errors
GitHub could not parse your workflow file as valid YAML, so the run never starts. The annotation names the file, line, and column of the first parse error.
What this error means
The run is rejected before any job executes, with an "Invalid workflow file" annotation in the Actions tab pointing at a specific line and column. No steps run because the file never compiled.
Invalid workflow file: .github/workflows/ci.yml#L14
You have an error in your yaml syntax on line 14Common causes
Bad indentation or a stray tab
YAML is whitespace-sensitive and forbids tabs for indentation. A misaligned key or a tab character pasted from an editor makes the parser reject the file.
Missing or misplaced required key
A workflow needs top-level on and jobs, and each job needs runs-on plus steps or uses. Omitting one, or nesting it at the wrong level, fails parsing or validation.
Unquoted value that YAML misreads
Values like on, off, yes, no, or strings that start with a special character get coerced or rejected unless quoted.
How to fix it
Validate the YAML locally before pushing
Lint the workflow with a YAML linter or actionlint, which understands the Actions schema, not just generic YAML.
# generic YAML check
yamllint .github/workflows/ci.yml
# Actions-aware linter (catches schema + expression errors)
actionlintFix indentation and quote ambiguous values
- Use spaces only, two per level, never tabs.
- Quote values that YAML coerces, for example branch names like on: or strings beginning with a special character.
- Confirm on, jobs, runs-on, and steps sit at the right nesting level.
How to prevent it
- Run actionlint in CI (or a pre-commit hook) so syntax errors fail fast.
- Add an .editorconfig that forces spaces, not tabs, in YAML files.
- Edit workflows with an editor extension that validates the Actions schema.