$CIRCLE_REPOSITORY_URL is empty when using GitLab

This doesn’t work

printenv reveals that $CIRCLE_REPOSITORY_URL is empty… is this a bug or am I doing something wrong?

I noticed other variables are not empty but seem to have wrong values:
CIRCLE_PROJECT_USERNAME
CIRCLE_PROJECT_REPONAME

printenv:


CIRCLE_REPOSITORY_URL=
CIRCLE_WORKING_DIRECTORY=/home/circleci/project
CIRCLECI=true
MY_RUBY_HOME=/opt/circleci/.rvm/rubies/ruby-3.1.2
CIRCLE_PROJECT_REPONAME=
CIRCLE_PROJECT_USERNAME=014xx-xxxxxx…
CIRCLE_BRANCH=master
HOME=/home/circleci

So this does look like a CircleCI + GitLab bug

The checkout command should fail since it uses the empty variable, but it doesn’t

The instructions in this page don’t work, I’m trying to replace checkout with a custom git command

This is the error i get

#!/bin/bash -eo pipefail
git clone --depth 1 -b “$CIRCLE_BRANCH” “$CIRCLE_REPOSITORY_URL”

fatal: repository ‘’ does not exist

CircleCI received exit code 128

Pls someone acknowledge this is a bug…

Now I’m trying to use pipeline values: pipeline.project.type / pipeline.project.git_url / pipeline.git.branch

pipeline.project.type: The lower-case name of the VCS provider, E.g. “github”, “bitbucket”.

So pipeline.project.type should be “gitlab”, but look at this:

#!/bin/bash -eo pipefail
echo “VCS provider: circleci”
pwd
git clone --depth 1 -b “” “” .

VCS provider: circleci
/home/circleci/project
fatal: repository ‘’ does not exist

CircleCI received exit code 128

Hmmm it looks like gitlab is not properly supported, I mean some variables are not set (or the values are wrong)

The special checkout command works, but it cannot be replaced with a custom command to clone or fetch a repo efficiently

And many other possible actions involving the affected buil-tin environment variables and pipeline values are not possible

That’s my experience so far, perhaps it will be fixed one day, but gitlab+cicleci does work unless you want to use affected variables and values …

Has nothing been done about this? We are using gitlab and $CIRCLE_REPOSITORY_URL is still empty.