GitLab CI "script ... exceeds the maximum size" - Inline Script Too Large
GitLab limits the size of inline job scripts written into .gitlab-ci.yml. Very large inline blocks (long heredocs, embedded programs) can exceed the limit and fail pipeline creation.
What this error means
Pipeline creation fails reporting that a job script exceeds the maximum allowed size, naming the oversized job.
This GitLab CI configuration is invalid:
jobs:deploy:script config exceeds the maximum size limitCommon causes
Huge inline script block
Embedding a large program or long heredoc directly in script bloats the YAML beyond the limit.
Generated YAML with inlined content
A generator that inlines file contents into script can blow past the cap.
How to fix it
Move logic into a committed script file
Keep the YAML small by calling a checked-in shell script.
deploy:
script:
- chmod +x ci/deploy.sh
- ci/deploy.shSplit the job
- Break one giant job into smaller jobs with focused scripts.
- Store reusable logic in scripts under a ci/ directory.
- Re-validate the file size in the Pipeline Editor.
How to prevent it
- Keep job scripts thin; call committed shell scripts for real logic.
- Avoid inlining file contents into YAML.
- Review generated pipelines for size before pushing.