Build annotated tags only

Is there any way in conditions to tell annotated tags apart from lightweight tags?

If not, I advocate the need for two further predicates besides tag IS blank and tag IS present: tag IS lightweight and tag IS annotated. Of course, both the previous would evaluate to false whenever there is no tag.

This could help, for instance, when deploying every commit on GitHub releases for skipping the second build triggered by the creation of a lightweight tag.

Could you be a little more specific? I don’t quite catch what you are trying to do, and any difference between the two types of tags for your purpose in particular.

AFAICS, if you are deploying every commit, you don’t need to deploy on tag builds at all – the version of the codebase that a tag has will have been deployed by the corresponding branch build.

I’ll try to clarify.
I automatically set the version of my projects depending on the git repository status. If there is an annotated tag, then the status is considered “stable”. If there is no annotated tag, is considered “unstable”, and a lightweight tag generated with git describe is produced for deploying on GitHub releases.

Now, on Travis, every time i commit, and by build and deployment is successful, a second build starts for the just created lightweight tag, wasting resources. That commit has already been tested and deployed, there’s no reason to run the build again.

See, e.g., this build that correctly terminated, deployed, and generated another unwanted build.

I am currently filtering them out with if: type != push OR tag IS blank OR tag ~= /^\d+(\.\d+)*$/, but that’s a kludge, what I’d like to express would be: if: type != push OR tag IS blank OR tag IS lightweight, this way I could create releases with arbitrary names.
Also, the build config would be more readable.

Let me know if I made myself clearer :slight_smile:

Cheers

Imprint