# GitHub Pull Request filtering based on target branch

**URL:** <https://forum.buildkite.community/t/github-pull-request-filtering-based-on-target-branch/269>\
**Category:** Features Requests\
**Created:** [January 24, 2019, 4:39pm UTC](https://forum.buildkite.community/t/github-pull-request-filtering-based-on-target-branch/269 "2019-01-24T16:39:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/tom/32/30_2.png) [@tom](https://forum.buildkite.community/u/tom)\
**Post date:** [January 24, 2019, 4:39pm UTC](https://forum.buildkite.community/t/github-pull-request-filtering-based-on-target-branch/269/1 "2019-01-24T16:39:14Z")

</div>

Note: This is a duplicate of [https://github.com/buildkite/feedback/issues/482](https://github.com/buildkite/feedback/issues/482).

Right now, you offer the ability to filter the triggering of builds based on the source branch of a pull request.

 ![](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/1X/46941a40a2098060f524f35a8c615dbf947ec713.png)

Functionality that I would love is to have the ability to filter based on target branch as well.

Here is my use case.

I’m using Buildkite as a replacement for Travis. I have two long-lived release branches in a single repo: `master` and `legacy` . Pull Requests are actively being opened against both branches, but they have entirely different pipeline requirements and are developed by separate teams.

I want to create two pipelines, one for each release branch. I want to be able to send post commit statuses from the correct pipeline to the appropriate PR.

What I would love is if I had the ability to natively filter when a Pull Request event triggered a build not only on the source branch (`/features/*`) but the target branch (`master` or `legacy`).

Thanks!

---

<div class="post-metadata">

**Author:** ![anon85971592](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anon85971592](https://forum.buildkite.community/u/anon85971592)\
**Post date:** [August 1, 2019, 3:13am UTC](https://forum.buildkite.community/t/github-pull-request-filtering-based-on-target-branch/269/2 "2019-08-01T03:13:59Z")

</div>

Just wanted to let everyone know we’ve got a solution for this behind a feature flag.

If someone stumbles across this and wants access, send us an email [hello@buildkite.com](mailto:hello@buildkite.com) and we’ll flip it on for you :)

---

<div class="post-metadata">

**Author:** ![juanitofatas](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/juanitofatas/32/957_2.png) [@juanitofatas](https://forum.buildkite.community/u/juanitofatas)\
**Post date:** [November 2, 2020, 1:38am UTC](https://forum.buildkite.community/t/github-pull-request-filtering-based-on-target-branch/269/3 "2020-11-02T01:38:08Z")

</div>

For future readers, this is now enabled for everyone. Please check

> **[Branch Configuration](https://buildkite.com/docs/pipelines/branch-configuration)**
>
> You can use branch patterns to ensure pipelines are only triggered when necessary. This guide shows you how to set up branch patterns for whole pipelines and individual build steps.

Thanks :-)
