GitHub Actions job exceeds the maximum number of steps
A single job has a maximum number of steps it may declare. A job that lists more than the allowed steps fails validation and does not run.
What this error means
A job fails to load with an error that it has too many steps or exceeds the per-job step limit.
github-actions
Error: Job 'build' has too many steps. A job may contain at most the maximum allowed number of steps.Common causes
Sequential steps used where a loop fits
Repeating near-identical steps inflates the count beyond the limit.
One job doing too much
A job that bundles many phases hits the step cap.
How to fix it
Collapse repetitive steps into one script
- Replace many similar steps with a single run step that loops.
- Move sequences into a committed script.
.github/workflows/ci.yml
steps:
- run: |
for t in a b c d; do ./run.sh "$t"; doneSplit the job
- Break the work across multiple jobs connected with needs.
- Use a matrix to parallelize repeated work instead of inline steps.
How to prevent it
- Loop in a script rather than enumerating steps.
- Split large jobs and use matrices for repetition.
Related guides
GitHub Actions workflow file exceeds the maximum size limitFix a workflow that fails to load because the YAML file is larger than the allowed maximum.
GitHub Actions "Job is about to start running but no steps"Fix a GitHub Actions job that is acquired by a runner but has no steps to execute, so it completes instantly…
GitHub Actions toJSON output too large to feed a dynamic matrixFix a dynamic matrix built from fromJSON(toJSON(...)) that fails because the generated JSON exceeds size limi…