GitHub Actions: Invalid workflow file: .github/workflows/ci.yml#L12 — You have an error in your yaml syntax on line 12
GitHub could not parse your workflow YAML, so no run was created — usually indentation, a tab, or an unquoted special character.
Invalid workflow fileYou have an error in your yaml syntax on lineInvalid workflow file: .github/workflowsmapping values are not allowed in this contextA mapping was not expected Meaning
The Actions tab shows a red banner with the file and line. YAML is strict: indentation must use spaces, a colon followed by a space starts a value, and strings that contain :, #, *, { or start with % or @ must be quoted. Wrong keys (runs_on) give a different "unexpected value" error but the same banner.
Common causes
- Tab characters or inconsistent indentation
- Unquoted string containing
:,#or a leading*/@/% - Misspelled or misplaced key (
runs_on,step:instead ofsteps:) - Expression
${{ }}with unbalanced braces or quotes - Duplicate keys or a list item at the wrong level
⚡ Quick fix
- Go to the line number in the message and check indentation first
- Quote values that contain
:or# - Lint locally with
actionlintoryamllintbefore pushing
Detailed fix by platform
GitHub Actions
- Install actionlint and run
actionlintin the repo root (also available as a pre-commit hook and VS Code extension)
Linux
python3 -c "import yaml,sys; yaml.safe_load(open('.github/workflows/ci.yml'))"prints the exact YAML parse error with line and column
Code examples
A frequent mistake and its fix
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Build: release" # quote values that contain ': '
run: echo "ok"
- uses: actions/checkout@v4 # 2-space indent, no tabsHow to diagnose
- Line — Which line does the banner point at?
- Whitespace — Tabs or mixed indentation?
- Lint — Does actionlint report more?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- .gitlab-ci.yml invalid GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts
- API rate limit exceeded GitHub Actions: HttpError: API rate limit exceeded for installation ID 123456 / secondary rate limit
- Config compilation failed CircleCI: Error calling workflow: 'build'. Cannot find a definition for job named test / Config does not conform to schema
Most viewed in CI/CD
- The process '/usr/bin/git' failed with exit code 128 GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128
- This job is stuck because you don't have any active runners GitLab CI: This job is stuck because you don't have any active runners online or available with any of these tags assigned to them
- Resource not accessible by integration GitHub Actions: Error: Resource not accessible by integration (403)
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Oct 2026