# CIRCLE\_BRANCH variable in for staging branch

**URL:** <https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689>\
**Category:** Integrations and Accounts\
**Created:** [March 14, 2016, 11:17pm UTC](https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689 "2016-03-14T23:17:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mateibeloiu](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@mateibeloiu](https://discuss.circleci.com/u/mateibeloiu)\
**Post date:** [March 14, 2016, 11:17pm UTC](https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689/1 "2016-03-14T23:17:06Z")

</div>

Greetings, I want to pass my branch name to the deployment staging section of circle.yml via the CIRCLE\_BRANCH variable, but it does not seam to work.

Here is my circle.yml file:

#n#Customize the test machine

machine:

timezone:

```
America/Los_Angeles # Set the timezone

```

java:

```
version: openjdk7

```

pre:

- export JAVA\_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0\_79.jdk/Contents/Home

- export ANT\_HOME=~/workspace/Ant

- export PATH="$ANT\_HOME/bin:$JAVA\_HOME/bin/java:$PATH"

## Customize deployment commands

deployment:

staging:

```
branch: $CIRCLE_BRANCH

commands:

 - ./testDeploy.sh

```

## Custom notifications

notify:

webhooks:

```
# A list of hashes representing hooks. Only the url field is supported.

- url: https://circleci.com/hooks/github
```

---

<div class="post-metadata">

**Author:** ![d3ming](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/d3ming/32/34_2.png) [@d3ming](https://discuss.circleci.com/u/d3ming)\
**Post date:** [March 15, 2016, 12:55am UTC](https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689/2 "2016-03-15T00:55:16Z")

</div>

If you are passing in the `$CIRCLE_BRANCH` for deploy, does that mean you want to deploy all branches?

If so, you can just add a a wildcard to the branch value like: `branch: /.*/`

---

<div class="post-metadata">

**Author:** ![mateibeloiu](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@mateibeloiu](https://discuss.circleci.com/u/mateibeloiu)\
**Post date:** [March 15, 2016, 10:16pm UTC](https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689/3 "2016-03-15T22:16:28Z")

</div>

That’s exactly what I was looking for. It worked, thanks so much.

---

<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:32am UTC](https://discuss.circleci.com/t/circle-branch-variable-in-for-staging-branch/2689/4 "2018-06-18T11:32:00Z")

</div>


