# Pipeline level branch filtering does not work as expected

**URL:** <https://forum.buildkite.community/t/pipeline-level-branch-filtering-does-not-work-as-expected/377>\
**Category:** General\
**Created:** [March 15, 2019, 7:15am UTC](https://forum.buildkite.community/t/pipeline-level-branch-filtering-does-not-work-as-expected/377 "2019-03-15T07:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdk](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/zdk/32/480_2.png) [@zdk](https://forum.buildkite.community/u/zdk)\
**Post date:** [March 15, 2019, 7:15am UTC](https://forum.buildkite.community/t/pipeline-level-branch-filtering-does-not-work-as-expected/377/1 "2019-03-15T07:15:36Z")

</div>

In Pipeline Settings → Steps (beta)

When I specify `branches` like the following:

```
branches: "master
steps:
  - name: ":skull_and_crossbones:"
    command: "make clean"
  - name: ":rubocop:"
    command: "make test"

```

Other branches than “master” also get triggered.

So, right now I have to put branches in each step which looks repetitive when you have many steps.

```
steps:
  - name: ":skull_and_crossbones:"
    command: "make clean"
    branches: "master"
  - name: ":rubocop:"
    command: "make test"
    branches: "master"

```

But it is understandable because it is the Steps menu 😁

Though what I am wondering is…  
Is there any other way in YAML web ui to filer branch at pipeline level that I am missing?

Any help would be appreciated!

Thanks!

---

<div class="post-metadata">

**Author:** ![anon59671738](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon59671738](https://forum.buildkite.community/u/anon59671738)\
**Post date:** [March 25, 2019, 2:21am UTC](https://forum.buildkite.community/t/pipeline-level-branch-filtering-does-not-work-as-expected/377/2 "2019-03-25T02:21:33Z")

</div>

Hey there @zdk, and welcome to the forum — thanks for posting! 👋🏼

First up, `branches: BRANCH_NAME` isn’t supported at the root level when defining a pipeline — it’s only supported at the step level, which is why your first example isn’t working how you expect.

You may be able to achieve what you want “Branch Limiting” though!

 ![18%20pm](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/1X/d0d5c45646d1963f4f89f74c06c4d216b8cef8b2.png)

This will allow pipelines to only create builds that match the filter patter, and will ignore non-matching ones completely. You can find this setting under “Github” in pipeline settings — hopefully that will do what you want!

Cheers,  
Justin

---

<div class="post-metadata">

**Author:** ![zdk](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/zdk/32/480_2.png) [@zdk](https://forum.buildkite.community/u/zdk)\
**Post date:** [March 25, 2019, 6:32am UTC](https://forum.buildkite.community/t/pipeline-level-branch-filtering-does-not-work-as-expected/377/3 "2019-03-25T06:32:21Z")

</div>

Oh, OK nice. I’ll try the `Branch Limiting`.  
Thanks for your reply.
