# Fetch the latest git tag(in the drone ref section) from drone task and use it as an ARG in the script in the same drone task

**URL:** <https://drone.discourse.group/t/fetch-the-latest-git-tag-in-the-drone-ref-section-from-drone-task-and-use-it-as-an-arg-in-the-script-in-the-same-drone-task/8030>\
**Category:** Drone Support\
**Created:** [January 3, 2020, 9:44am UTC](https://drone.discourse.group/t/fetch-the-latest-git-tag-in-the-drone-ref-section-from-drone-task-and-use-it-as-an-arg-in-the-script-in-the-same-drone-task/8030 "2020-01-03T09:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![veereshreddy123](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@veereshreddy123](https://drone.discourse.group/u/veereshreddy123)\
**Post date:** [January 3, 2020, 9:44am UTC](https://drone.discourse.group/t/fetch-the-latest-git-tag-in-the-drone-ref-section-from-drone-task-and-use-it-as-an-arg-in-the-script-in-the-same-drone-task/8030/1 "2020-01-03T09:44:19Z")

</div>

Example:  
deploy-prod:  
when:  
event: tag  
ref:  
- refs/tags/k8s.prod.gcp.v1  
image: [docker.hub.com/prod/kustomize:latest](http://docker.hub.com/prod/kustomize:latest)  
pull: true  
- ./deploy.sh . ARG
