# Branch + PR filtering

**URL:** <https://discuss.circleci.com/t/branch-pr-filtering/33582>\
**Category:** Build Environment\
**Created:** [December 2, 2019, 8:38am UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582 "2019-12-02T08:38:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsaadep](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jsaadep/32/24896_2.png) [@jsaadep](https://discuss.circleci.com/u/jsaadep)\
**Post date:** [December 2, 2019, 8:38am UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582/1 "2019-12-02T08:38:06Z")

</div>

Hello,

In a lot of CI workflows, we have 2 main workflows:  
1- Analyze code when Pull Request is made.  
2- Deploy when code is merged on specific branches (ex: master)

It seems circleci only supports one or the either but not both options at the same time.

Am I assuming this correctly?

---

<div class="post-metadata">

**Author:** ![gmemstr](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/gmemstr/32/22922_2.png) [@gmemstr](https://discuss.circleci.com/u/gmemstr)\
**Post date:** [December 2, 2019, 1:42pm UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582/2 "2019-12-02T13:42:08Z")

</div>

Heya @jsaadep, CircleCI does offer the ability to only build on pull requests, which will also build the default branch (typically master). This can be found under the Advanced Settings for the project 🙂

---

<div class="post-metadata">

**Author:** ![jsaadep](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jsaadep/32/24896_2.png) [@jsaadep](https://discuss.circleci.com/u/jsaadep)\
**Post date:** [December 2, 2019, 1:51pm UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582/3 "2019-12-02T13:51:30Z")

</div>

Indeed, but it does not allow some other usual CI scenarios:

Build on PR  
Also build on specific branches (not only on master).

---

<div class="post-metadata">

**Author:** ![escakot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/escakot/32/25841_2.png) [@escakot](https://discuss.circleci.com/u/escakot)\
**Post date:** [October 23, 2020, 2:32pm UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582/4 "2020-10-23T14:32:39Z")

</div>

This would be a nice feature to have. We’re currently using CircleCI and this was unfortunately a limitation for us.  
We wanted to achieve a Trigger on every commit to `master`, `distribute/*` and `release/*` branches. Every other branch requires an open PR.

Recently tried Azure Pipelines for a Xamarin app and they support it. Example azure config below:

```yaml
# Trigger pipelines for branches on every commit 
trigger:
  branches:
    include:
    - master
    - releases/*
    exclude:
    - releases/old*

# Trigger pipelines for branches with an Open PR
pr:
  branches:
    include:
    - master
    - releases/*
    exclude:
    - releases/old*

```

---

<div class="post-metadata">

**Author:** ![JonathanC503](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jonathanc503/32/24364_2.png) [@JonathanC503](https://discuss.circleci.com/u/JonathanC503)\
**Post date:** [October 27, 2020, 3:05am UTC](https://discuss.circleci.com/t/branch-pr-filtering/33582/5 "2020-10-27T03:05:44Z")

</div>

Hello @escakot - Thank you for the feedback here. This is definitely a feature request that we are tracking here: [https://ideas.circleci.com/cloud-feature-requests/p/allow-branch-whitelist-to-override-only-build-pull-requests](https://ideas.circleci.com/cloud-feature-requests/p/allow-branch-whitelist-to-override-only-build-pull-requests)
