By default, drone will execute first:
git remote add origin <repository.git>
git fetch --no-tags origin +refs/heads/master
But I don’t want to have the --no-tags parameter on the second command. What should I do?
The reason is that I need to execute
git describe --tags in the shell to get the current version.
Thank you all!
UPDATED as of Drone 1.x tags are no longer fetched by default. If you would like to fetch tags you can add the following step to your pipeline:
+ - name: fetch
+ image: alpine/git
+ - git fetch --tags
- name: build
- go build
- go test
Not sure why, but this doesn’t work for me.
@rmorshea the syntax in this post is intended for older version of Drone (I will edit accordingly). For newer versions of Drone you can use this guide to customize cloning: