# Issue: Can not load latest .drone.yml when using refs/tags/ to trigger pipeline

**URL:** <https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168>\
**Category:** Drone Support\
**Created:** [June 25, 2019, 9:49am UTC](https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168 "2019-06-25T09:49:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juggernaut0425](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/juggernaut0425/32/3913_2.png) [@juggernaut0425](https://drone.discourse.group/u/juggernaut0425)\
**Post date:** [June 25, 2019, 9:49am UTC](https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168/1 "2019-06-25T09:49:17Z")

</div>

## Environment

- Drone 1.2.1
- Kubernetes
- Gogs 0.11.79.1211

## Steps to reproduce this issue

**1. Create .drone.yml**

```auto
kind: pipeline
name: default
steps:
- name: test-tag-v1
  image: alpine
  commands:
  - echo 'test-tag-v1'
  when:
    ref:
    - refs/tags/v*

```

**2. Create and push tag**

> git tag v1.0 && git push origin v1.0

**3. Triggered successfully**

 ![QQ20190708-181943%402x](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/8/8f8b65f3e0d1ec78bb0822230a83ab1bdbf9e363.png)

**4. Edit .drone.yml**  
I increased version from 1 to 2.

```auto
kind: pipeline
name: default
steps:
- name: test-tag-v2
  image: alpine
  commands:
  - echo 'test-tag-v2'
  when:
    ref:
    - refs/tags/v*

```

**6. Push and Create tag**

> git add . && git commit -a -m ‘update .drone.yml’  
> git tag v2.0 && git push origin v2.0

**7. Output was not corrected**

 ![QQ20190708-182118%402x](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/e/e07b4c869fe8caee1f555daf5c9067703748af71.png)

It seems that it was caused by cache. The cache key are all the same for different tags.  
[contents.go#L20](https://github.com/drone/drone/blob/3650a5d21bbf086fa8d2f16b0067ddeecfa604df/service/content/cache/contents.go#L20)

```
// content key pattern used in the cache, comprised of the
// repository slug, commit and path.
const contentKey = "%s/%s/%s"

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [July 8, 2019, 3:58pm UTC](https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168/2 "2019-07-08T15:58:53Z")

</div>

See the following issues:

- [https://github.com/gogs/gogs/pull/5689](https://github.com/gogs/gogs/pull/5689)
- [https://github.com/gogs/gogs/issues/4363](https://github.com/gogs/gogs/issues/4363)

There are two issues / features that need to be resolved / implemented by gogs. Note that these have already been [implemented](https://github.com/go-gitea/gitea/issues/286) by gitea. These are:

1. gogs does not allow fetching a file by reference
2. gogs does not include commit sha in the tag payload

---

<div class="post-metadata">

**Author:** ![juggernaut0425](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/juggernaut0425/32/3913_2.png) [@juggernaut0425](https://drone.discourse.group/u/juggernaut0425)\
**Post date:** [August 19, 2019, 4:05am UTC](https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168/3 "2019-08-19T04:05:36Z")

</div>

Hi @bradrydzewski,  
The issue still exists after I upgrade Gogs. The commit sha was included in the tag payload.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [August 19, 2019, 4:36am UTC](https://drone.discourse.group/t/issue-can-not-load-latest-drone-yml-when-using-refs-tags-to-trigger-pipeline/11168/4 "2019-08-19T04:36:43Z")

</div>

> The commit sha was included in the tag payload.

Drone requires a code change to read the value. There is an open pull request for this and we hope to include in our next release.
