CircleCi 2.1 filter by tags not working!

workflows:
  version: 2.1
  build_and_deploy:
    jobs:
      ...
      - deploy_prod:
          requires:
            - lint
            - test
            - build_docker
          filters:
            branches:
              only: master
            tags:
              only: prod

To my understanding, having two filters (branches and tags) results in the logical or, which is what I want. But tagging and pushing a commit with git tag -f prod <gitsha_1> triggers a new build but doesn’t respect the tags filter. The $CIRCLE_TAG environment variable is also always empty.

Figured out I had to put filters on all related (required) jobs of the downstream job, i.e. the tags -> only -> /.*/ filter.

Might want to simplify the config API in regards to interaction between filtering with tags and branches. A lot of threads here having the same issues. Why not passing the tag all the way down to the downstream job. Basically being able to skip making the dummy /.*/ filter and treat branches/tags as a logical OR… or for those wanting the logical AND, they would be able to set the operator option operator: AND (or required on the filters)

2 Likes