# Cloning failed in Github Deployment

**URL:** <https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637>\
**Category:** Drone Support\
**Created:** [February 29, 2020, 7:37am UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637 "2020-02-29T07:37:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanjunlee](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/hanjunlee/32/5751_2.png) [@hanjunlee](https://drone.discourse.group/u/hanjunlee)\
**Post date:** [February 29, 2020, 7:37am UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637/1 "2020-02-29T07:37:08Z")

</div>

Hi

Thank you for the implementation of Drone.  
I have encountered the situation that cloning has failed for the `promote` event. The error message is as below.

```auto
+ git fetch origin +refs/tags/11d8ccc32ed82ba423d341c5ed3c7115ed0b0014:
fatal: Couldn't find remote ref refs/tags/11d8ccc32ed82ba423d341c5ed3c7115ed0b0014

```

I’m using Drone for the public repository of Github. I hope you reply it.

---

<div class="post-metadata">

**Author:** ![ashwilliams1](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ashwilliams1/32/5549_2.png) [@ashwilliams1](https://drone.discourse.group/u/ashwilliams1)\
**Post date:** [February 29, 2020, 5:27pm UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637/2 "2020-02-29T17:27:29Z")

</div>

Hmm, we received and merged a patch to fix this quite a while back …

> <https://github.com/drone/drone-git/pull/1>

---

<div class="post-metadata">

**Author:** ![mreifman](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mreifman](https://drone.discourse.group/u/mreifman)\
**Post date:** [April 7, 2020, 4:20pm UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637/3 "2020-04-07T16:20:48Z")

</div>

I’ve encountered the issue in the original post that isn’t addressed by that patch.

I’m creating a GitHub deployment where the `ref` parameter is a SHA, but when Drone parses the deployment webhook it doesn’t seem to take that case into account:

> <https://github.com/drone/go-scm/blob/731e51dbb685830bcd259e4a5deb33cb7b906110/scm/driver/github/webhook.go#L386-L391>

Drone prepends `refs/tags` to the SHA, which causes results in getting the wrong clone type downstream.

This bug looks related:  
[http://discuss.harness.io/t/github-deployments-trigger-bad-cloning-stage/6410](http://discuss.harness.io/t/github-deployments-trigger-bad-cloning-stage/6410)

---

<div class="post-metadata">

**Author:** ![ashwilliams1](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ashwilliams1/32/5549_2.png) [@ashwilliams1](https://drone.discourse.group/u/ashwilliams1)\
**Post date:** [April 7, 2020, 4:32pm UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637/4 "2020-04-07T16:32:01Z")

</div>

Thanks for the analysis. Perhaps the payload is different depending on whether or not you are promoting a tag, a commit or a pull request. As a next step, we would kindly as that you provide a sample hook payload that we can use to reproduce. We will create a unit test using the sample payload, which should allow us to patch accordingly.

---

<div class="post-metadata">

**Author:** ![mreifman](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mreifman](https://drone.discourse.group/u/mreifman)\
**Post date:** [April 8, 2020, 12:19am UTC](https://drone.discourse.group/t/cloning-failed-in-github-deployment/8637/5 "2020-04-08T00:19:21Z")

</div>

Thanks, @ashwilliams1. Here you go: [https://github.com/drone/go-scm/pull/59](https://github.com/drone/go-scm/pull/59)
