Why does the runner create a directory with root permission?

Hello,
The script of the runner is as follows:

    - shopt -s extglob
    - cd /mnt/location
    - rm -rf .* !(node_modules) 
    - git clone --no-checkout http://USER:PASS@172.20.2.57/project/location.git /mnt/location/temp.tmp 
    - mv /mnt/location/temp.tmp/.git /mnt/location/
    - rmdir /mnt/location/temp.tmp
    - cd /mnt/location
    - git reset --hard HEAD
    - cd /mnt/location
    - npm install

After the script finishes, a directory called dist is created with root permissions. Why?

drwxr-xr-x   7 root          root            4096 Apr 30 16:56 dist
-rw-r--r--   1 gitlab-runner gitlab-runner    395 Apr 30 16:55 Dockerfile
-rw-r--r--   1 gitlab-runner gitlab-runner     64 Apr 30 16:55 nest-cli.json
drwxr-xr-x 604 gitlab-runner gitlab-runner  20480 Apr 30 16:56 node_modules
-rw-r--r--   1 gitlab-runner gitlab-runner   2915 Apr 30 16:55 package.json
-rw-r--r--   1 gitlab-runner gitlab-runner 823270 Apr 30 16:56 package-lock.json
-rw-r--r--   1 gitlab-runner gitlab-runner    626 Apr 30 16:55 README.md
drwxr-xr-x   7 gitlab-runner gitlab-runner   4096 Apr 30 16:55 src
-rw-r--r--   1 gitlab-runner gitlab-runner     97 Apr 30 16:55 tsconfig.build.json
-rw-r--r--   1 gitlab-runner gitlab-runner    546 Apr 30 16:55 tsconfig.json

How to solve it?

Thank you.