# Want to set the the branch for the deployment section in circle.yml

**URL:** <https://discuss.circleci.com/t/want-to-set-the-the-branch-for-the-deployment-section-in-circle-yml/5154>\
**Category:** Deployments\
**Tags:** circle-yml\
**Created:** [July 15, 2016, 7:07am UTC](https://discuss.circleci.com/t/want-to-set-the-the-branch-for-the-deployment-section-in-circle-yml/5154 "2016-07-15T07:07:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh87](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rakesh87/32/13478_2.png) [@rakesh87](https://discuss.circleci.com/u/rakesh87)\
**Post date:** [July 15, 2016, 7:07am UTC](https://discuss.circleci.com/t/want-to-set-the-the-branch-for-the-deployment-section-in-circle-yml/5154/1 "2016-07-15T07:07:58Z")

</div>

Hi,

Is there any way in which I can pass the branch as a dyanamic variable to circle.yml.

example:

suppose I want to deploy a ‘random\_new’ branch to server if all test are green how can I achive that in circle.yml

```
deployment:
  staging: 
    branch: $dynamic_branch || master
    commands:
      - curl -X POST https://hooks.cloud66.com/stacks/redeploy/my_cloud_redeploy_url
```

---

<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:41am UTC](https://discuss.circleci.com/t/want-to-set-the-the-branch-for-the-deployment-section-in-circle-yml/5154/2 "2018-06-18T11:41:04Z")

</div>


