diff --git a/.gitlab/ci/templates/gem.gitlab-ci.yml b/.gitlab/ci/templates/gem.gitlab-ci.yml
index 5e39d1f1ec6995e16c18030c71b4044cbc9740e5..3e19019a4640dcc7ea750bc266bf11e9de2a7641 100644
--- a/.gitlab/ci/templates/gem.gitlab-ci.yml
+++ b/.gitlab/ci/templates/gem.gitlab-ci.yml
@@ -22,6 +22,8 @@ spec:
 gems $[[inputs.gem_name]]:
   extends: ".gems:rules:$[[inputs.gem_name]]"
   needs: []
+  rules:
+    - exists: ["$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/.gitlab-ci.yml"]
   trigger:
     include: "$[[inputs.gem_path_prefix]]$[[inputs.gem_name]]/.gitlab-ci.yml"
     strategy: depend