How to add ssh key for exec runner?

I am testing drone ci in my local setup. My git repos are private and cloning over https is disabled. I am trying to figure out how I can tell drone CI to use ssh instead of https because it’s currently failing to even clone the repo.

This is not possible. Drone uses git+https and the oauth2 token to clone and authenticate with your git repository. There is no support for git+ssh. You could disable the default clone step [1] and then implement your own clone logic, however, this is not something we recommend or officially support.


I see. Yeah, I can see why you wouldn’t recommend it. Do you have any other recommendation for my case? Unfortunately I cannot enable cloning over https.

In this case, custom clone logic is going to be your only option.

With that being said, I would be open to a pull request to drone-runners/drone-runner-exec that lets you override the default clone logic with a custom script. For example DRONE_CLONE_SCRIPT=... provides an optional absolute path to a clone script to override the default clone logic.