Skip to content
Latchkey

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

  1. Replace many similar steps with a single run step that loops.
  2. Move sequences into a committed script.
.github/workflows/ci.yml
steps:
  - run: |
      for t in a b c d; do ./run.sh "$t"; done

Split the job

  1. Break the work across multiple jobs connected with needs.
  2. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →