Filters branches not working properly with workflows

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.

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.

off course, done.

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

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