CIRCLE_REPOSITORY_URL changed format in v2



I have noticed the CIRCLE_REPOSITORY_URL variable that CircleCi provides in builds (docs) has changed between v1 and v2. I migrated a project and in v1 I got a format of but in v2 I get a format of i.e. I now get the ssh clone string. I would argue that the new format isn’t a URL so should be called by a different ENV var name.

The reason this is a problem is that we use this ENV var in a Slack message to the dev team to link to the repo being built, and the link is broken since migrating to v2. Apart from this small thing, the migration was fantastic, the build is 5 minutes faster which we are very happy about.

Checkout with https rather than git protocol


I’m not 100% sure just yet but that might be a bug. I’ve filed in internal issue to get this solved. Thank you for letting us know.


I’d like to checkout my source using https rather than git protocol. It’s a public repo. I believe the default was https with CircleCI 1.0. I’ve removed the ssh deploy key from my CircleCI configuration. I don’t see a parameter to the checkout command of .circleci/config.yml to specify the git protocol.

I currently have:
I’d like:



The workaround that I’m using is to set the environment variable CIRCLE_REPOSITORY_URL in my .circleci/config.yml. See for example



The change appears to be intentional. I see the following code in the “Checkout” stage. Is this code in CircleCI’s GitHub somewhere?

# use git+ssh instead of https
git config --global url."ssh://".insteadOf "" || true



Thanks for the info. You inspired me to do a similar fix. In my case it was in Ansible code using jinja2 replace() to “fix” the repo url in a slack message

"<{{ repourl | replace('','') | replace('.git','') }}/commit/{{ gitcommit | default('?') }}|{{ gitcommit | truncate(7, True) }}>"


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.