Filters branches not working properly with workflows

2.0
workflows

#1

I have following config.yml with workflows in that:

workflows:
  version: 2

  build_test_deploy:
    jobs:
      - build
      - deploy_prod:
          requires:
            - build
          filters:
            branches:
              only: master

But filters isn’t working for master branch. When I push to dev branch I always get running jobs for that branch too.
Anyone know what is the problem here?

PS. in dev git branch I have the same config.yml as for master and I don’t use job-level branching.


#3

I checked again and in the repo I really have .circleci/config.yml
It’s just my mistake in this post.
Also all logic with artifacts and workflows are working but except filters.


#5

off course, done.


#6

Hi all, I changed our config to following and now it works as expected:

workflows:
  version: 2

  build_test_deploy:
    jobs:
      - build:
          filters:
            branches:
              only: master
      - deploy_prod:
          requires:
            - build
          filters:
            branches:
              only: master

closed #7

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