Git tags during build


in my workflow I tag git commits before updating master which is then automatically build with netlify. I’m using git describe to get the current version to show up in my app.

However it looks like Netlify doesn’t fetch tags when building. This means the output of git describe is something like 1.0.3-14-3hj34b2(14 commits after the last tag it found). It works if I clear the build cache and rebuild.

Is there a way to get Netlify to also fetch new tags during build?


Hey @Markus,
We currently have an open feature request for this internally, but as far as I can tell, it is not currently implemented. I will update this if I learn otherwise.

One hacky thing you might try is seeing if you can experiment with different git commands’ exit codes here to get us to not ignore the build:

We also recently rolled out Build Plugins, which have a git utility that may be able to do some checking before build, i.e., in onPreBuild:

Let us know if we can help further with any of that.

Thanks for the answer.

The build is not ignored so everything is good there. It just does not update the git tags, i assume because it runs git pull without tags.

I’ll have a look at the build plugin.