SSH runner: Honor clone depth property from pipeline on checkout

When using the SSH runner from DockerHub drone/drone-runner-ssh:latest with a pipeline like:

kind: pipeline
type: ssh
name: ci

server:
  host: XXX
  user: XXX
  ssh_key:
    from_secret: XXX

clone:
  depth: 1

steps:
- name: hello
  commands:
  - echo Hello

…the output shows that the depth: 1 property is not respected although the docs say so:

+ git init
Initialized empty Git repository in /tmp/drone-DNfuPrrazu5C3MMX/drone/src/.git/
+ git remote add origin XXX
+ git fetch  origin +refs/heads/add-ci:
From XXX
 * branch            add-ci     -> FETCH_HEAD
 * [new branch]      add-ci     -> origin/add-ci
+ git checkout XXX -b add-ci
Switched to a new branch 'add-ci'

I opened a PR to address this in https://github.com/drone-runners/drone-runner-ssh/pull/2

1 Like