Workflow not triggering on my tag filter

I currently have 2 workflows with their own filters.

I have a workflow that filters on master branch and /^v.*/ tags. But its still firing off jobs when I don’t expect it to be (ie commits that are not tagged).

Here’s my config file.

Hopefully there’s a good explanation out there.

1 Like

This is not possible, but not because of a CircleCI restriction - it is because, as I understand it, that the requirement does not make sense in Git terms.

The reason is as follows. If you push a tag, it does not have a branch - it is merely a pointer to a commit that could be on any branch. To illustrate this, imagine you have a master branch, a development branch, and a feature branch. master = development = aabbcc, and feature = ddeeff. Now let’s set a tag v.0.0.1 to aabbcc and follow it with git push --follow-tags.

Git can work out which branch this new tag appears in, but it points to the HEAD of both master and development - so it cannot resolve to just one branch. Imagine you pushed a tag that was the first ever commit to the repo - it would resolve to all branches!

More info here, plus a potential alternative approach: