# Deploy with regexp branch skipped with error \`branch not permitted\`

**URL:** <https://travis-ci.community/t/deploy-with-regexp-branch-skipped-with-error-branch-not-permitted/4276>\
**Category:** Deployment\
**Tags:** conditions, deployment, script-deployment\
**Created:** [July 19, 2019, 10:56am UTC](https://travis-ci.community/t/deploy-with-regexp-branch-skipped-with-error-branch-not-permitted/4276 "2019-07-19T10:56:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![apoorvam](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@apoorvam](https://travis-ci.community/u/apoorvam)\
**Post date:** [July 19, 2019, 10:56am UTC](https://travis-ci.community/t/deploy-with-regexp-branch-skipped-with-error-branch-not-permitted/4276/1 "2019-07-19T10:56:05Z")

</div>

Hi,

I have specified multiple deploy script providers:

1. Last three deploys are only on master branch, so its right to skip them.
2. The first deploy which is on all branches matching regexp: `/^release\/.*$/` should run for this branch `release/2.1.5`. However it’s skipping this deploy too.

Can someone point why the release branch deploy is skipped in this case? I want the first deploy to run on linux and release branches only like: `release/2.1.5`.

Travis build: [https://travis-ci.org/leopardslab/dunner/jobs/560593148](https://travis-ci.org/leopardslab/dunner/jobs/560593148)  
Travis Config file: [https://github.com/leopardslab/dunner/blob/172a4c5792b0a8389556cc8ee4f690dc73fafb6e/.travis.yml](https://github.com/leopardslab/dunner/blob/172a4c5792b0a8389556cc8ee4f690dc73fafb6e/.travis.yml)

– Apoorva

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [July 21, 2019, 8:36am UTC](https://travis-ci.community/t/deploy-with-regexp-branch-skipped-with-error-branch-not-permitted/4276/2 "2019-07-21T08:36:21Z")

</div>

```auto
deploy:

- <...>
  on:
    <...>
    branches:
      only:
      - /^release\/.*$/

```

I don’t see this syntax anywhere in [https://docs.travis-ci.com/user/deployment](https://docs.travis-ci.com/user/deployment).

According to [https://docs.travis-ci.com/user/deployment#examples-of-conditional-deployment](https://docs.travis-ci.com/user/deployment#examples-of-conditional-deployment), the syntax is rather:

```auto
condition: $TRAVIS_BRANCH =~ ^(staging|production)$

```

[AFAICS from the code](https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/addons/deploy/conditions.rb#L70-L75), `condition:` is a Ruby expression, and it can also be a list whose entries would be joined with logical AND.
