# Help with filtering rules

**URL:** <https://discuss.circleci.com/t/help-with-filtering-rules/24205>\
**Category:** Build Environment\
**Created:** [August 9, 2018, 11:42pm UTC](https://discuss.circleci.com/t/help-with-filtering-rules/24205 "2018-08-09T23:42:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipeecst](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felipeecst/32/16364_2.png) [@felipeecst](https://discuss.circleci.com/u/felipeecst)\
**Post date:** [August 9, 2018, 11:42pm UTC](https://discuss.circleci.com/t/help-with-filtering-rules/24205/1 "2018-08-09T23:42:08Z")

</div>

I have the following workflow config:

```
workflows:
  version: 2
  deployment:
    jobs:
      - test
      - staging_approval:
          type: approval
          requires:
            - test
          filters:
            branches:
              only: master
      - staging:
          requires:
            - staging_approval
      - production_approval:
          type: approval
          requires:
            - staging
      - production:
          requires:
            - production_approval

```

The current behavior is:

- The test step runs for every commit in every branch.
- The staging\_approval and the following steps only run for the master branch.

I want to achieve the following:

- The test step runs for every commit in every branch, except for the master branch.
- The staging\_approval and the following steps only run for the master branch.

I can’t find a way to achieve that using filters, as one filter would conflict with the other one. Can anyone help me figuring out?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [November 7, 2018, 11:42pm UTC](https://discuss.circleci.com/t/help-with-filtering-rules/24205/2 "2018-11-07T23:42:16Z")

</div>

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