Repository: firecow/gitlab-ci-local
Pull request #1123 (2024-03-02 07:54:00)

feat: Maximum nested includes
Implements https://docs.gitlab.com/ee/administration/settings/continuous_integration.html#maximum-includes and removed `depth` check as well as `excludedGlob`

Breaking changes:
- refer to the `include-local-wildcard` test case.


PigeonF: I don't mind closing #1122 in favor of this PR.
firecow: @ANGkeith Eslint failing :smile: 

Patch:
diff --git a/package-lock.json b/package-lock.json
index 6fc6f6e..fe19f99 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -68,13 +68,13 @@
       }
     },
     "node_modules/@ampproject/remapping": {
-      "version": "2.2.1",
-      "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
-      "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
+      "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
       "dev": true,
       "dependencies": {
-        "@jridgewell/gen-mapping": "^0.3.0",
-        "@jridgewell/trace-mapping": "^0.3.9"
+        "@jridgewell/gen-mapping": "^0.3.5",
+        "@jridgewell/trace-mapping": "^0.3.24"
       },
       "engines": {
         "node": ">=6.0.0"
@@ -174,9 +174,9 @@
       }
     },
     "node_modules/@babel/core": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz",
-      "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz",
+      "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==",
       "dev": true,
       "dependencies": {
         "@ampproject/remapping": "^2.2.0",
@@ -184,11 +184,11 @@
         "@babel/generator": "^7.23.6",
         "@babel/helper-compilation-targets": "^7.23.6",
         "@babel/helper-module-transforms": "^7.23.3",
-        "@babel/helpers": "^7.23.9",
-        "@babel/parser": "^7.23.9",
-        "@babel/template": "^7.23.9",
-        "@babel/traverse": "^7.23.9",
-        "@babel/types": "^7.23.9",
+        "@babel/helpers": "^7.24.0",
+        "@babel/parser": "^7.24.0",
+        "@babel/template": "^7.24.0",
+        "@babel/traverse": "^7.24.0",
+        "@babel/types": "^7.24.0",
         "convert-source-map": "^2.0.0",
         "debug": "^4.1.0",
         "gensync": "^1.0.0-beta.2",
@@ -318,9 +318,9 @@
       }
     },
     "node_modules/@babel/helper-plugin-utils": {
-      "version": "7.22.5",
-      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
-      "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz",
+      "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==",
       "dev": true,
       "engines": {
         "node": ">=6.9.0"
@@ -378,14 +378,14 @@
       }
     },
     "node_modules/@babel/helpers": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz",
-      "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz",
+      "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==",
       "dev": true,
       "dependencies": {
-        "@babel/template": "^7.23.9",
-        "@babel/traverse": "^7.23.9",
-        "@babel/types": "^7.23.9"
+        "@babel/template": "^7.24.0",
+        "@babel/traverse": "^7.24.0",
+        "@babel/types": "^7.24.0"
       },
       "engines": {
         "node": ">=6.9.0"
@@ -477,9 +477,9 @@
       }
     },
     "node_modules/@babel/parser": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
-      "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz",
+      "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==",
       "dev": true,
       "bin": {
         "parser": "bin/babel-parser.js"
@@ -666,23 +666,23 @@
       }
     },
     "node_modules/@babel/template": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz",
-      "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz",
+      "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==",
       "dev": true,
       "dependencies": {
         "@babel/code-frame": "^7.23.5",
-        "@babel/parser": "^7.23.9",
-        "@babel/types": "^7.23.9"
+        "@babel/parser": "^7.24.0",
+        "@babel/types": "^7.24.0"
       },
       "engines": {
         "node": ">=6.9.0"
       }
     },
     "node_modules/@babel/traverse": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz",
-      "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz",
+      "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==",
       "dev": true,
       "dependencies": {
         "@babel/code-frame": "^7.23.5",
@@ -691,8 +691,8 @@
         "@babel/helper-function-name": "^7.23.0",
         "@babel/helper-hoist-variables": "^7.22.5",
         "@babel/helper-split-export-declaration": "^7.22.6",
-        "@babel/parser": "^7.23.9",
-        "@babel/types": "^7.23.9",
+        "@babel/parser": "^7.24.0",
+        "@babel/types": "^7.24.0",
         "debug": "^4.3.1",
         "globals": "^11.1.0"
       },
@@ -701,9 +701,9 @@
       }
     },
     "node_modules/@babel/types": {
-      "version": "7.23.9",
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz",
-      "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==",
+      "version": "7.24.0",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz",
+      "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==",
       "dev": true,
       "dependencies": {
         "@babel/helper-string-parser": "^7.23.4",
@@ -1289,14 +1289,14 @@
       }
     },
     "node_modules/@jridgewell/gen-mapping": {
-      "version": "0.3.4",
-      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz",
-      "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==",
+      "version": "0.3.5",
+      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
+      "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
       "dev": true,
       "dependencies": {
-        "@jridgewell/set-array": "^1.0.1",
+        "@jridgewell/set-array": "^1.2.1",
         "@jridgewell/sourcemap-codec": "^1.4.10",
-        "@jridgewell/trace-mapping": "^0.3.9"
+        "@jridgewell/trace-mapping": "^0.3.24"
       },
       "engines": {
         "node": ">=6.0.0"
@@ -1312,9 +1312,9 @@
       }
     },
     "node_modules/@jridgewell/set-array": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
-      "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
+      "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
       "dev": true,
       "engines": {
         "node": ">=6.0.0"
@@ -1327,9 +1327,9 @@
       "dev": true
     },
     "node_modules/@jridgewell/trace-mapping": {
-      "version": "0.3.23",
-      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz",
-      "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==",
+      "version": "0.3.25",
+      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+      "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
       "dev": true,
       "dependencies": {
         "@jridgewell/resolve-uri": "^3.1.0",
@@ -1579,9 +1579,9 @@
       "dev": true
     },
     "node_modules/@types/node": {
-      "version": "20.11.20",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz",
-      "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==",
+      "version": "20.11.24",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz",
+      "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==",
       "dev": true,
       "dependencies": {
         "undici-types": "~5.26.4"
@@ -1645,16 +1645,16 @@
       "dev": true
     },
     "node_modules/@typescript-eslint/eslint-plugin": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.0.tgz",
-      "integrity": "sha512-j6vT/kCulhG5wBmGtstKeiVr1rdXE4nk+DT1k6trYkwlrvW9eOF5ZbgKnd/YR6PcM4uTEXa0h6Fcvf6X7Dxl0w==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz",
+      "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==",
       "dev": true,
       "dependencies": {
         "@eslint-community/regexpp": "^4.5.1",
-        "@typescript-eslint/scope-manager": "7.1.0",
-        "@typescript-eslint/type-utils": "7.1.0",
-        "@typescript-eslint/utils": "7.1.0",
-        "@typescript-eslint/visitor-keys": "7.1.0",
+        "@typescript-eslint/scope-manager": "7.1.1",
+        "@typescript-eslint/type-utils": "7.1.1",
+        "@typescript-eslint/utils": "7.1.1",
+        "@typescript-eslint/visitor-keys": "7.1.1",
         "debug": "^4.3.4",
         "graphemer": "^1.4.0",
         "ignore": "^5.2.4",
@@ -1680,15 +1680,15 @@
       }
     },
     "node_modules/@typescript-eslint/parser": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.0.tgz",
-      "integrity": "sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz",
+      "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/scope-manager": "7.1.0",
-        "@typescript-eslint/types": "7.1.0",
-        "@typescript-eslint/typescript-estree": "7.1.0",
-        "@typescript-eslint/visitor-keys": "7.1.0",
+        "@typescript-eslint/scope-manager": "7.1.1",
+        "@typescript-eslint/types": "7.1.1",
+        "@typescript-eslint/typescript-estree": "7.1.1",
+        "@typescript-eslint/visitor-keys": "7.1.1",
         "debug": "^4.3.4"
       },
       "engines": {
@@ -1708,13 +1708,13 @@
       }
     },
     "node_modules/@typescript-eslint/scope-manager": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.0.tgz",
-      "integrity": "sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz",
+      "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "7.1.0",
-        "@typescript-eslint/visitor-keys": "7.1.0"
+        "@typescript-eslint/types": "7.1.1",
+        "@typescript-eslint/visitor-keys": "7.1.1"
       },
       "engines": {
         "node": "^16.0.0 || >=18.0.0"
@@ -1725,13 +1725,13 @@
       }
     },
     "node_modules/@typescript-eslint/type-utils": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.0.tgz",
-      "integrity": "sha512-UZIhv8G+5b5skkcuhgvxYWHjk7FW7/JP5lPASMEUoliAPwIH/rxoUSQPia2cuOj9AmDZmwUl1usKm85t5VUMew==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz",
+      "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/typescript-estree": "7.1.0",
-        "@typescript-eslint/utils": "7.1.0",
+        "@typescript-eslint/typescript-estree": "7.1.1",
+        "@typescript-eslint/utils": "7.1.1",
         "debug": "^4.3.4",
         "ts-api-utils": "^1.0.1"
       },
@@ -1752,9 +1752,9 @@
       }
     },
     "node_modules/@typescript-eslint/types": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.0.tgz",
-      "integrity": "sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz",
+      "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==",
       "dev": true,
       "engines": {
         "node": "^16.0.0 || >=18.0.0"
@@ -1765,13 +1765,13 @@
       }
     },
     "node_modules/@typescript-eslint/typescript-estree": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.0.tgz",
-      "integrity": "sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz",
+      "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "7.1.0",
-        "@typescript-eslint/visitor-keys": "7.1.0",
+        "@typescript-eslint/types": "7.1.1",
+        "@typescript-eslint/visitor-keys": "7.1.1",
         "debug": "^4.3.4",
         "globby": "^11.1.0",
         "is-glob": "^4.0.3",
@@ -1793,17 +1793,17 @@
       }
     },
     "node_modules/@typescript-eslint/utils": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz",
-      "integrity": "sha512-WUFba6PZC5OCGEmbweGpnNJytJiLG7ZvDBJJoUcX4qZYf1mGZ97mO2Mps6O2efxJcJdRNpqweCistDbZMwIVHw==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz",
+      "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==",
       "dev": true,
       "dependencies": {
         "@eslint-community/eslint-utils": "^4.4.0",
         "@types/json-schema": "^7.0.12",
         "@types/semver": "^7.5.0",
-        "@typescript-eslint/scope-manager": "7.1.0",
-        "@typescript-eslint/types": "7.1.0",
-        "@typescript-eslint/typescript-estree": "7.1.0",
+        "@typescript-eslint/scope-manager": "7.1.1",
+        "@typescript-eslint/types": "7.1.1",
+        "@typescript-eslint/typescript-estree": "7.1.1",
         "semver": "^7.5.4"
       },
       "engines": {
@@ -1818,12 +1818,12 @@
       }
     },
     "node_modules/@typescript-eslint/visitor-keys": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.0.tgz",
-      "integrity": "sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz",
+      "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "7.1.0",
+        "@typescript-eslint/types": "7.1.1",
         "eslint-visitor-keys": "^3.4.1"
       },
       "engines": {
@@ -1841,59 +1841,59 @@
       "dev": true
     },
     "node_modules/@vue/compiler-core": {
-      "version": "3.4.19",
-      "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.19.tgz",
-      "integrity": "sha512-gj81785z0JNzRcU0Mq98E56e4ltO1yf8k5PQ+tV/7YHnbZkrM0fyFyuttnN8ngJZjbpofWE/m4qjKBiLl8Ju4w==",
+      "version": "3.4.21",
+      "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz",
+      "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==",
       "dev": true,
       "dependencies": {
         "@babel/parser": "^7.23.9",
-        "@vue/shared": "3.4.19",
+        "@vue/shared": "3.4.21",
         "entities": "^4.5.0",
         "estree-walker": "^2.0.2",
         "source-map-js": "^1.0.2"
       }
     },
     "node_modules/@vue/compiler-dom": {
-      "version": "3.4.19",
-      "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.19.tgz",
-      "integrity": "sha512-vm6+cogWrshjqEHTzIDCp72DKtea8Ry/QVpQRYoyTIg9k7QZDX6D8+HGURjtmatfgM8xgCFtJJaOlCaRYRK3QA==",
+      "version": "3.4.21",
+      "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz",
+      "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==",
       "dev": true,
       "dependencies": {
-        "@vue/compiler-core": "3.4.19",
-        "@vue/shared": "3.4.19"
+        "@vue/compiler-core": "3.4.21",
+        "@vue/shared": "3.4.21"
       }
     },
     "node_modules/@vue/compiler-sfc": {
-      "version": "3.4.19",
-      "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.19.tgz",
-      "integrity": "sha512-LQ3U4SN0DlvV0xhr1lUsgLCYlwQfUfetyPxkKYu7dkfvx7g3ojrGAkw0AERLOKYXuAGnqFsEuytkdcComei3Yg==",
+      "version": "3.4.21",
+      "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz",
+      "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==",
       "dev": true,
       "dependencies": {
         "@babel/parser": "^7.23.9",
-        "@vue/compiler-core": "3.4.19",
-        "@vue/compiler-dom": "3.4.19",
-        "@vue/compiler-ssr": "3.4.19",
-        "@vue/shared": "3.4.19",
+        "@vue/compiler-core": "3.4.21",
+        "@vue/compiler-dom": "3.4.21",
+        "@vue/compiler-ssr": "3.4.21",
+        "@vue/shared": "3.4.21",
         "estree-walker": "^2.0.2",
-        "magic-string": "^0.30.6",
-        "postcss": "^8.4.33",
+        "magic-string": "^0.30.7",
+        "postcss": "^8.4.35",
         "source-map-js": "^1.0.2"
       }
     },
     "node_modules/@vue/compiler-ssr": {
-      "version": "3.4.19",
-      "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.19.tgz",
-      "integrity": "sha512-P0PLKC4+u4OMJ8sinba/5Z/iDT84uMRRlrWzadgLA69opCpI1gG4N55qDSC+dedwq2fJtzmGald05LWR5TFfLw==",
+      "version": "3.4.21",
+      "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz",
+      "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==",
       "dev": true,
       "dependencies": {
-        "@vue/compiler-dom": "3.4.19",
-        "@vue/shared": "3.4.19"
+        "@vue/compiler-dom": "3.4.21",
+        "@vue/shared": "3.4.21"
       }
     },
     "node_modules/@vue/shared": {
-      "version": "3.4.19",
-      "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.19.tgz",
-      "integrity": "sha512-/KliRRHMF6LoiThEy+4c1Z4KB/gbPrGjWwJR+crg2otgrf/egKzRaCPvJ51S5oetgsgXLfc4Rm5ZgrKHZrtMSw==",
+      "version": "3.4.21",
+      "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz",
+      "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==",
       "dev": true
     },
     "node_modules/acorn": {
@@ -2397,9 +2397,9 @@
       }
     },
     "node_modules/caniuse-lite": {
-      "version": "1.0.30001589",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz",
-      "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==",
+      "version": "1.0.30001593",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001593.tgz",
+      "integrity": "sha512-UWM1zlo3cZfkpBysd7AS+z+v007q9G1+fLTUU42rQnY6t2axoogPW/xol6T7juU5EUoOhML4WgBIdG+9yYqAjQ==",
       "dev": true,
       "funding": [
         {
@@ -2891,9 +2891,9 @@
       }
     },
     "node_modules/electron-to-chromium": {
-      "version": "1.4.681",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.681.tgz",
-      "integrity": "sha512-1PpuqJUFWoXZ1E54m8bsLPVYwIVCRzvaL+n5cjigGga4z854abDnFRc+cTa2th4S79kyGqya/1xoR7h+Y5G5lg==",
+      "version": "1.4.690",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.690.tgz",
+      "integrity": "sha512-+2OAGjUx68xElQhydpcbqH50hE8Vs2K6TkAeLhICYfndb67CVH0UsZaijmRUE3rHlIxU1u0jxwhgVe6fK3YANA==",
       "dev": true
     },
     "node_modules/emittery": {
@@ -4757,9 +4757,9 @@
       }
     },
     "node_modules/magic-string": {
-      "version": "0.30.7",
-      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz",
-      "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==",
+      "version": "0.30.8",
+      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz",
+      "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==",
       "dev": true,
       "dependencies": {
         "@jridgewell/sourcemap-codec": "^1.4.15"
@@ -6456,9 +6456,9 @@
       }
     },
     "node_modules/typescript": {
-      "version": "5.3.3",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
-      "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
+      "version": "5.4.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
+      "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
       "dev": true,
       "bin": {
         "tsc": "bin/tsc",
diff --git a/src/parser-includes.ts b/src/parser-includes.ts
index 63dfeab..31c7f6e 100644
--- a/src/parser-includes.ts
+++ b/src/parser-includes.ts
@@ -14,19 +14,27 @@ type ParserIncludesInitOptions = {
     writeStreams: WriteStreams;
     gitData: GitData;
     fetchIncludes: boolean;
-    excludedGlobs: string[];
     variables: {[key: string]: string};
 };
 
+const MAXIMUM_INCLUDE = 150; // https://docs.gitlab.com/ee/administration/settings/continuous_integration.html#maximum-includes
+
 export class ParserIncludes {
+    private static count: number = 0;
+
+    static resetCount (): void {
+        this.count = 0;
+    }
 
-    static async init (gitlabData: any, depth: number, opts: ParserIncludesInitOptions): Promise<any[]> {
+    static async init (gitlabData: any, opts: ParserIncludesInitOptions): Promise<any[]> {
+        this.count++;
+        assert(
+            this.count <= MAXIMUM_INCLUDE + 1, // 1st init call is not counted
+            chalk`This GitLab CI configuration is invalid: Maximum of {blueBright ${MAXIMUM_INCLUDE}} nested includes are allowed!.`
+        );
         let includeDatas: any[] = [];
         const promises = [];
-        const {stateDir, cwd, fetchIncludes, gitData, excludedGlobs} = opts;
-
-        assert(depth < 100, chalk`circular dependency detected in \`include\``);
-        depth++;
+        const {stateDir, cwd, fetchIncludes, gitData} = opts;
 
         const include = this.expandInclude(gitlabData["include"], opts.variables);
 
@@ -70,11 +78,10 @@ export class ParserIncludes {
                 }
             }
             if (value["local"]) {
-                const files = await globby([value["local"].replace(/^\//, ""), ...excludedGlobs], {dot: true, cwd});
+                const files = await globby([value["local"].replace(/^\//, "")], {dot: true, cwd});
                 for (const localFile of files) {
                     const content = await Parser.loadYaml(`${cwd}/${localFile}`, {inputs: value.inputs || {}});
-                    excludedGlobs.push(`!${localFile}`);
-                    includeDatas = includeDatas.concat(await this.init(content, depth, opts));
+                    includeDatas = includeDatas.concat(await this.init(content, opts));
                 }
             } else if (value["project"]) {
                 for (const fileValue of Array.isArray(value["file"]) ? value["file"] : [value["file"]]) {
@@ -92,7 +99,7 @@ export class ParserIncludes {
                         };
                     });
 
-                    includeDatas = includeDatas.concat(await this.init(fileDoc, depth, opts));
+                    includeDatas = includeDatas.concat(await this.init(fileDoc, opts));
                 }
             } else if (value["template"]) {
                 const {project, ref, file, domain} = this.covertTemplateToProjectFile(value["template"]);
@@ -100,13 +107,13 @@ export class ParserIncludes {
                 const fileDoc = await Parser.loadYaml(
                     `${cwd}/${stateDir}/includes/${fsUrl}`, {inputs: value.inputs || {}}
                 );
-                includeDatas = includeDatas.concat(await this.init(fileDoc, depth, opts));
+                includeDatas = includeDatas.concat(await this.init(fileDoc, opts));
             } else if (value["remote"]) {
                 const fsUrl = Utils.fsUrl(value["remote"]);
                 const fileDoc = await Parser.loadYaml(
                     `${cwd}/${stateDir}/includes/${fsUrl}`, {inputs: value.inputs || {}}
                 );
-                includeDatas = includeDatas.concat(await this.init(fileDoc, depth, opts));
+                includeDatas = includeDatas.concat(await this.init(fileDoc, opts));
             } else {
                 throw new AssertionError({message: `Didn't understand include ${JSON.stringify(value)}`});
             }
diff --git a/src/parser.ts b/src/parser.ts
index 2f11ed0..452b65b 100644
--- a/src/parser.ts
+++ b/src/parser.ts
@@ -84,10 +84,12 @@ export class Parser {
 
         let yamlDataList: any[] = [{stages: [".pre", "build", "test", "deploy", ".post"]}];
         const gitlabCiData = await Parser.loadYaml(`${cwd}/${file}`);
-        yamlDataList = yamlDataList.concat(await ParserIncludes.init(gitlabCiData, 0, {cwd, stateDir, writeStreams, gitData, fetchIncludes, excludedGlobs: [], variables: expanded}));
+        yamlDataList = yamlDataList.concat(await ParserIncludes.init(gitlabCiData, {cwd, stateDir, writeStreams, gitData, fetchIncludes, variables: expanded}));
+        ParserIncludes.resetCount();
 
         const gitlabCiLocalData = await Parser.loadYaml(`${cwd}/.gitlab-ci-local.yml`);
-        yamlDataList = yamlDataList.concat(await ParserIncludes.init(gitlabCiLocalData, 0, {cwd, stateDir, writeStreams, gitData, fetchIncludes, excludedGlobs: [], variables: expanded}));
+        yamlDataList = yamlDataList.concat(await ParserIncludes.init(gitlabCiLocalData, {cwd, stateDir, writeStreams, gitData, fetchIncludes, variables: expanded}));
+        ParserIncludes.resetCount();
 
         const gitlabData: any = deepExtend({}, ...yamlDataList);
 


Test patch:
diff --git a/tests/test-cases/include-inputs/input-templates/basic-example/.gitlab-ci.yml b/tests/test-cases/include-inputs/input-templates/basic-example/.gitlab-ci.yml
index 3937896..f3e6d19 100644
--- a/tests/test-cases/include-inputs/input-templates/basic-example/.gitlab-ci.yml
+++ b/tests/test-cases/include-inputs/input-templates/basic-example/.gitlab-ci.yml
@@ -2,8 +2,12 @@
 include:
   - local: '/.gitlab-ci-input-template.yml'
     inputs:
-      message: hello world
+      message: hello website
       options_input: website
+  - local: '/.gitlab-ci-input-template.yml'
+    inputs:
+      message: hello db
+      options_input: db
 
 stages:
   - test
diff --git a/tests/test-cases/include-inputs/integration.include-inputs.test.ts b/tests/test-cases/include-inputs/integration.include-inputs.test.ts
index 5f03b4a..0d8ad2b 100644
--- a/tests/test-cases/include-inputs/integration.include-inputs.test.ts
+++ b/tests/test-cases/include-inputs/integration.include-inputs.test.ts
@@ -23,9 +23,14 @@ stages:
   - .post
 scan-website:
   script:
-    - echo hello world
-    - echo hello world
-    - echo hello world`;
+    - echo hello website
+    - echo hello website
+    - echo hello website
+scan-db:
+  script:
+    - echo hello db
+    - echo hello db
+    - echo hello db`;
 
     expect(writeStreams.stdoutLines[0]).toEqual(expected);
 });
diff --git a/tests/test-cases/include-local-wildcard/.gitlab-ci.yml b/tests/test-cases/include-local-wildcard/.gitlab-ci.yml
index f793c79..87e6872 100644
--- a/tests/test-cases/include-local-wildcard/.gitlab-ci.yml
+++ b/tests/test-cases/include-local-wildcard/.gitlab-ci.yml
@@ -1,3 +1,3 @@
 ---
 include:
-  local: '*.gitlab-ci.yml'
+  local: '/.gitlab/*.gitlab-ci.yml'
diff --git a/tests/test-cases/include-local-wildcard/build-images.gitlab-ci.yml b/tests/test-cases/include-local-wildcard/.gitlab/build-images.gitlab-ci.yml
similarity index 100%
rename from tests/test-cases/include-local-wildcard/build-images.gitlab-ci.yml
rename to tests/test-cases/include-local-wildcard/.gitlab/build-images.gitlab-ci.yml
diff --git a/tests/test-cases/include-local-wildcard/cache-repo.gitlab-ci.yml b/tests/test-cases/include-local-wildcard/.gitlab/cache-repo.gitlab-ci.yml
similarity index 100%
rename from tests/test-cases/include-local-wildcard/cache-repo.gitlab-ci.yml
rename to tests/test-cases/include-local-wildcard/.gitlab/cache-repo.gitlab-ci.yml
diff --git a/tests/test-cases/include-local-wildcard/docs.gitlab-ci.yml b/tests/test-cases/include-local-wildcard/.gitlab/docs.gitlab-ci.yml
similarity index 100%
rename from tests/test-cases/include-local-wildcard/docs.gitlab-ci.yml
rename to tests/test-cases/include-local-wildcard/.gitlab/docs.gitlab-ci.yml
diff --git a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts
index 8182fc4..ff71695 100644
--- a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts
+++ b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts
@@ -13,7 +13,6 @@ test("include-local-wildcard <build-job>", async () => {
         cwd: "tests/test-cases/include-local-wildcard",
         file: ".gitlab-ci.yml",
     }, writeStreams);
-
     const output = writeStreams.stdoutLines.join();
     expect(output).toContain("build-images executed!");
     expect(output).toContain("cache-repo executed!");
diff --git a/tests/test-cases/include-nested/.150-complex-nested-include-gitlab-ci.yml b/tests/test-cases/include-nested/.150-complex-nested-include-gitlab-ci.yml
new file mode 100644
index 0000000..ec448b1
--- /dev/null
+++ b/tests/test-cases/include-nested/.150-complex-nested-include-gitlab-ci.yml
@@ -0,0 +1,78 @@
+---
+include:
+  # Total of 75 * 2 include below
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
diff --git a/tests/test-cases/include-nested/.150-nested-include-gitlab-ci.yml b/tests/test-cases/include-nested/.150-nested-include-gitlab-ci.yml
new file mode 100644
index 0000000..7bd7cb6
--- /dev/null
+++ b/tests/test-cases/include-nested/.150-nested-include-gitlab-ci.yml
@@ -0,0 +1,156 @@
+---
+include:
+  # Total of 150 include below
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+
+stages:
+  - test
diff --git a/tests/test-cases/include-nested/.151-complex-nested-include-gitlab-ci.yml b/tests/test-cases/include-nested/.151-complex-nested-include-gitlab-ci.yml
new file mode 100644
index 0000000..0498602
--- /dev/null
+++ b/tests/test-cases/include-nested/.151-complex-nested-include-gitlab-ci.yml
@@ -0,0 +1,80 @@
+---
+include:
+  - local: '/basic-template.yml'
+
+  # Total of 75 * 2 include below
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
+  - local: '/nested-template.yml'
diff --git a/tests/test-cases/include-nested/.151-nested-include-gitlab-ci.yml b/tests/test-cases/include-nested/.151-nested-include-gitlab-ci.yml
new file mode 100644
index 0000000..17a415d
--- /dev/null
+++ b/tests/test-cases/include-nested/.151-nested-include-gitlab-ci.yml
@@ -0,0 +1,157 @@
+---
+include:
+  # Total of 151 include below
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+  - local: '/basic-template.yml'
+
+stages:
+  - test
diff --git a/tests/test-cases/include-nested/basic-template.yml b/tests/test-cases/include-nested/basic-template.yml
new file mode 100644
index 0000000..192bcf4
--- /dev/null
+++ b/tests/test-cases/include-nested/basic-template.yml
@@ -0,0 +1,4 @@
+---
+job:
+  script:
+    - echo 1
diff --git a/tests/test-cases/include-nested/integration.needs-empty.test.ts b/tests/test-cases/include-nested/integration.needs-empty.test.ts
new file mode 100644
index 0000000..6a923c8
--- /dev/null
+++ b/tests/test-cases/include-nested/integration.needs-empty.test.ts
@@ -0,0 +1,68 @@
+import {WriteStreamsMock} from "../../../src/write-streams";
+import {handler} from "../../../src/handler";
+import {initSpawnSpy} from "../../mocks/utils.mock";
+import assert, {AssertionError} from "assert";
+import {WhenStatics} from "../../mocks/when-statics";
+import chalk from "chalk";
+import {ParserIncludes} from "../../../src/parser-includes";
+
+beforeAll(() => {
+    initSpawnSpy(WhenStatics.all);
+});
+
+beforeEach(() => {
+    ParserIncludes.resetCount();
+});
+
+test("include-nested 150 nested include", async () => {
+    const writeStreams = new WriteStreamsMock();
+    await handler({
+        cwd: "tests/test-cases/include-nested",
+        file: ".150-nested-include-gitlab-ci.yml",
+        preview: true,
+    }, writeStreams);
+
+});
+
+test("include-nested 151 nested include", async () => {
+    try {
+        const writeStreams = new WriteStreamsMock();
+        await handler({
+            cwd: "tests/test-cases/include-nested",
+            file: ".151-nested-include-gitlab-ci.yml",
+            preview: true,
+        }, writeStreams);
+    } catch (e: any) {
+        assert(e instanceof AssertionError, "e is not instanceof AssertionError");
+        expect(e.message).toEqual(chalk`This GitLab CI configuration is invalid: Maximum of {blueBright 150} nested includes are allowed!.`);
+        return;
+    }
+
+    throw new Error("Error is expected but not thrown/caught");
+});
+
+test("include-nested 150 complex nested include", async () => {
+    const writeStreams = new WriteStreamsMock();
+    await handler({
+        cwd: "tests/test-cases/include-nested",
+        file: ".150-complex-nested-include-gitlab-ci.yml",
+        preview: true,
+    }, writeStreams);
+});
+
+test("include-nested 151 complex nested include", async () => {
+    try {
+        const writeStreams = new WriteStreamsMock();
+        await handler({
+            cwd: "tests/test-cases/include-nested",
+            file: ".151-complex-nested-include-gitlab-ci.yml",
+            preview: true,
+        }, writeStreams);
+    } catch (e: any) {
+        assert(e instanceof AssertionError, "e is not instanceof AssertionError");
+        expect(e.message).toEqual(chalk`This GitLab CI configuration is invalid: Maximum of {blueBright 150} nested includes are allowed!.`);
+        return;
+    }
+
+    throw new Error("Error is expected but not thrown/caught");
+});
diff --git a/tests/test-cases/include-nested/nested-template.yml b/tests/test-cases/include-nested/nested-template.yml
new file mode 100644
index 0000000..41ead99
--- /dev/null
+++ b/tests/test-cases/include-nested/nested-template.yml
@@ -0,0 +1,3 @@
+---
+include:
+  - local: '/basic-template.yml'