diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 749f8a9f6f9409538eb7d0265a445173fad68765..f7cc9cb9d97a285681061d58255ca55e6624c1e6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,8 +11,17 @@ publish_npm:
     - apk add --update protobuf-dev
     - apk add --update yarn
     - apk add --update git
-    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "git@gitlab.com:"
-    - git submodule sync && git submodule update --init
+    - git config --global credential.helper store
+    - git config --global credential.useHttpPath true
+    - |
+      git credential approve <<EOF
+      protocol=https
+      host=gitlab.com
+      path=my-group/my-submodule-repo.git
+      username=${CI_DEPENDENCY_PROXY_USER}
+      password=${CI_DEPENDENCY_PROXY_PASSWORD}
+      EOF
+    - git submodule update --init --recursive
 
   rules:
     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'