cicd
workflow_syntax
ai_generated
true
Error: .github/workflows/ci.yml: Unexpected value 'on'
ID: cicd/gha-workflow-syntax-error
95%Fix Rate
93%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
GitHub Actions workflow YAML file contains syntax errors such as incorrect indentation, invalid keys, or malformed expressions. The workflow fails before any jobs run.
genericWorkarounds
-
93% success Validate the workflow YAML locally using actionlint before pushing
Install actionlint (brew install actionlint or download binary), run 'actionlint .github/workflows/ci.yml' and fix all reported issues
-
88% success Use the GitHub Actions workflow editor in the browser for real-time validation
Navigate to repo > Actions > New workflow, paste your YAML, and fix any red-underlined errors before committing
Dead Ends
Common approaches that don't work:
-
Blindly re-indent the entire YAML file with a text editor auto-format
55% fail
Auto-formatters can break YAML anchors, multi-line strings, and GitHub Actions-specific syntax like ${{ }} expressions
-
Copy a workflow template from an outdated blog post without adapting it
60% fail
GitHub Actions syntax evolves; older templates may use deprecated keys or removed features
-
Ignore the error and re-run the workflow hoping it passes
99% fail
Syntax errors are deterministic and will never self-resolve on retry
Error Chain
Leads to:
Preceded by:
Frequently confused with: