# Force branches to build only some, on the web

**URL:** <https://discuss.circleci.com/t/force-branches-to-build-only-some-on-the-web/19771>\
**Category:** Build Environment\
**Tags:** 2.0, circle-yml\
**Created:** [January 31, 2018, 5:28pm UTC](https://discuss.circleci.com/t/force-branches-to-build-only-some-on-the-web/19771 "2018-01-31T17:28:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![victor.castillo](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/victor.castillo/32/17753_2.png) [@victor.castillo](https://discuss.circleci.com/u/victor.castillo)\
**Post date:** [January 31, 2018, 5:28pm UTC](https://discuss.circleci.com/t/force-branches-to-build-only-some-on-the-web/19771/1 "2018-01-31T17:28:52Z")

</div>

Is there a way to force the builds only on certain branches, but in the application, for example, suppose I have the next `config.yml`:

```
version: 2
jobs:
  build:
    machine: true
    working_directory: ~/api
    branches:
      only:
        - master
    steps:
      - checkout
      - deploy:
          command: then bash ./bin_deploy/scripts_circle/deploy_production.sh;

```

My question is how do I protect the deploy to production, if someone changes the code to:

```
version: 2
jobs:
  build:
    machine: true
    working_directory: ~/api
    branches:
      only:
        - fake_master_merged
    steps:
      - checkout
      - deploy:
          command: then bash ./bin_deploy/scripts_circle/deploy_production.sh;

```

It will deploy to production, is there a way to force only the master builds in the app, or even to create the environment variables per branch?

Thanks in advance

---

<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:** [June 18, 2018, 11:40am UTC](https://discuss.circleci.com/t/force-branches-to-build-only-some-on-the-web/19771/2 "2018-06-18T11:40:16Z")

</div>


