What can be wrong with this workflow? The 2nd stage is not triggered

circle.yml
workflow

#1

Hello,

I have built a workflow to trigger automated deploys on several tags. The problem is that it is not getting triggered when I push a tag matching the regular expression. The first stage is triggered just as planned. What can be an issue?

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            tags:
              only: /^v?\d+.\d+.\d+(-(alpha|beta|rc)(.\d+)?)?$/
            branches:
              ignore: /.*/

#2

Would you give an example of a tag that should match but does not?


#3

v0.2.1-alpha, for instance. Tested it on regex101.com, may be the problem was with the way I did it: tagged already pushed commit and then pushed the tag.


#4

OK. I’d suggest removing the anchors and putting in a trivial regex, e.g. matching v, to see if that works, then build incrementally from there. Also, check the docs to see if you actually need the // delimiters.

Finally, is the tags filter more powerful than the branches filter? If not, then getting branches to ignore all would ignore would ignore everything, even if it matches a tag only filter.


#5

I don’t think so. It was working when those stages were in two separate workflows.


#6

Resolved by setting tags filter for build stage to /.*/


#7

Great! There is a “solved” button in each answer, and you can click it to mark the answer as the solution.


#8

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.