# Recommendations for tagging and version updates

**URL:** <https://drone.discourse.group/t/recommendations-for-tagging-and-version-updates/10908>\
**Category:** Drone Support\
**Created:** [May 1, 2018, 12:36am UTC](https://drone.discourse.group/t/recommendations-for-tagging-and-version-updates/10908 "2018-05-01T00:36:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JaredReisinger](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jaredreisinger/32/3692_2.png) [@JaredReisinger](https://drone.discourse.group/u/JaredReisinger)\
**Post date:** [May 1, 2018, 12:36am UTC](https://drone.discourse.group/t/recommendations-for-tagging-and-version-updates/10908/1 "2018-05-01T00:36:50Z")

</div>

I have drone (0.8.5) successfully responding to GitHub events on our repos, and am trying to understand the “expected” pattern that Drone wants with regards to tagging, deployment, etc. Currently, when a PR is merged to master we’re doing the following in our `.drone.yml`:

```auto
  bump-version:
    when:
      event: [push]
    image: node:8.11.1
    commands:
      - "npm --unsafe-perm version patch -m 'version bump: %s [ci skip]'"
      - git push --follow-tags --set-upstream origin master

  gcr:
    when:
      event: [tag]
    image: plugins/gcr
    registry: us.gcr.io
    secrets: [google_credentials]
    repo: OUR-GCR/OUR-SERVICE
    auto_tag: true

```

The `[ci skip]` in the comment (for the commit created by `npm version`) is needed to ensure that the push of the version update doesn’t trigger another build and version bump. The problem is that this means that the webhook for the tag event _also_ has the `[ci skip]` comment, and thus gets ignored. We _could_ do the GCR publish on the `push` event as well, but then `auto_tag: true` only tags the image with `latest`, and not with the version numbers.

Are we going about things the wrong way? To me, `npm version` is _ **the** _ way you are supposed to update a package’s version number, and doing this via CI/CD after a PR is merged to master is the appropriate time to bump the version if you want it to be automated. Is there some other way to ensure that the commit from the `git push` won’t cause a subsequent build, but the tag from the push will? Alternatively, is there a way to allow the GCR (a.k.a. drone-docker) plugin to make use of the tags on the `push` event instead of only on the `tag` event?

---

<div class="post-metadata">

**Author:** ![JaredReisinger](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jaredreisinger/32/3692_2.png) [@JaredReisinger](https://drone.discourse.group/u/JaredReisinger)\
**Post date:** [May 1, 2018, 7:57pm UTC](https://drone.discourse.group/t/recommendations-for-tagging-and-version-updates/10908/2 "2018-05-01T19:57:33Z")

</div>

One option would be to allow the `auto_tag`/`default_tags` option to work the same during the `push` event as it does in the `tag` event… especially since you can easily _not_ ask for the automatic tags if you specifically only want “latest”. If you’re open to this as an option, I could provide a PR for the drone-docker plugin.
