GitHub Actions workflow file exceeds the maximum size limit
GitHub enforces a maximum size for an individual workflow file. A workflow that grows past that limit - often from huge inline matrices or embedded scripts - fails to load and does not run.
What this error means
A workflow does not run and reports that the workflow file exceeds the maximum allowed size.
github-actions
Error: The workflow file is too large. Workflow files must be smaller than the maximum allowed size.Common causes
Large inline scripts or matrices
Big embedded run blocks or sprawling matrices bloat the file past the limit.
Everything in one monolithic workflow
Combining many jobs and inline config in a single file pushes it over the size cap.
How to fix it
Extract scripts and split the workflow
- Move large run blocks into committed scripts and call them.
- Split logical groups into separate workflow files or reusable workflows.
.github/workflows/ci.yml
steps:
- run: ./scripts/build.sh
- run: ./scripts/test.shGenerate dynamic matrices instead of inlining
- Replace huge inline matrices with a job that emits a compact matrix via fromJSON.
- This shrinks the static file substantially.
How to prevent it
- Keep run blocks in scripts and workflows modular.
- Use reusable workflows to avoid monolithic files.
Related guides
GitHub Actions job exceeds the maximum number of stepsFix a job that fails to load because it declares more steps than GitHub Actions allows.
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…
GitHub Actions "This run likely failed because of a workflow file issue"Fix the GitHub Actions startup failure "This run likely failed because of a workflow file issue" - the workfl…