# Pull Requests and Multiple Default Branches

**URL:** <https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459>\
**Category:** Deployments\
**Created:** [April 13, 2018, 12:28pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459 "2018-04-13T12:28:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristopherJohnson25](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@ChristopherJohnson25](https://discuss.circleci.com/u/ChristopherJohnson25)\
**Post date:** [April 13, 2018, 12:28pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/1 "2018-04-13T12:28:41Z")

</div>

Hi all, this may have been asked before, but figured I’d see if there have been any updates recently.

A big part of my CI process is leveraging GitHub pull requests. I do not need to run a build on every commit, but I need to run a build on each pull request. Upon merging the pull request, I do need to run another build. I know this is currently possible with the ‘Pull Request Only’ setting and merging to GitHub’s default branch, but is there any way I can have this functionality with multiple default branches? Every time I want to merge to my production branch, I’ll have to change the default branch, not ideal. Example below…

PR submitted -\> run build -\> Merge to branch ‘frontend-staging’ run build on merge -\> 'frontend-staging PR submitted (with merge to master) -\> Merge branch to master, run build on merge again.

Hope this makes sense! Let me know if you have any thoughts…

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [April 13, 2018, 1:11pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/2 "2018-04-13T13:11:05Z")

</div>

I’ve not looked into this in detail, but you could run a build on a schedule, and then do your internal logic (should a real build be run) inside. If a real build should not be run, exit early and return a success condition.

This has the disadvantage that you will have many successful builds that were not actually builds, but it’d get you up and running.

---

<div class="post-metadata">

**Author:** ![ChristopherJohnson25](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@ChristopherJohnson25](https://discuss.circleci.com/u/ChristopherJohnson25)\
**Post date:** [April 13, 2018, 1:15pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/3 "2018-04-13T13:15:37Z")

</div>

Wow, they don’t make it easy do they!? I’ll play around with this method, thanks!

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [April 13, 2018, 1:16pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/4 "2018-04-13T13:16:57Z")

</div>

> [@ChristopherJohnson25](#):
>
> Wow, they don’t make it easy do they!?

They aren’t trying to inconvenience you deliberately 😺

If you lurk hereabouts, and on the Ideas board, you’ll see there is a lot of stuff competing for CircleCI product manager attention.

The other thing you could think about is using the HTTP API externally to make trigger decisions. I believe you can kick off a build using this. You’d need another server for this, but a cheapie would be fine.

---

<div class="post-metadata">

**Author:** ![ChristopherJohnson25](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@ChristopherJohnson25](https://discuss.circleci.com/u/ChristopherJohnson25)\
**Post date:** [April 13, 2018, 1:18pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/5 "2018-04-13T13:18:04Z")

</div>

Ok cool, will check it 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:** [July 12, 2018, 1:18pm UTC](https://discuss.circleci.com/t/pull-requests-and-multiple-default-branches/21459/6 "2018-07-12T13:18:12Z")

</div>

Closed on July 12, 2018, 1:18pm UTC

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