# TCIE Enterprise Completley Blocked (Can't Push) Travis CI: Run after\_success on a specific branch

**URL:** <https://travis-ci.community/t/tcie-enterprise-completley-blocked-cant-push-travis-ci-run-after-success-on-a-specific-branch/13567>\
**Category:** Feature Requests\
**Tags:** bug\
**Created:** [February 9, 2023, 5:53pm UTC](https://travis-ci.community/t/tcie-enterprise-completley-blocked-cant-push-travis-ci-run-after-success-on-a-specific-branch/13567 "2023-02-09T17:53:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![howtotalktogirls](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/howtotalktogirls/32/8432_2.png) [@howtotalktogirls](https://travis-ci.community/u/howtotalktogirls)\
**Post date:** [February 9, 2023, 5:53pm UTC](https://travis-ci.community/t/tcie-enterprise-completley-blocked-cant-push-travis-ci-run-after-success-on-a-specific-branch/13567/1 "2023-02-09T17:53:59Z")

</div>

I would like to know how to run an `after_success` script only for a specific branch.

```auto

after_success:
  - # some deployment script
  on: prod

#2

branches:
  only:
    - prod
    after_success:
      - # some deployment script
#3

after_success:
  branches:
    only:
      - prod
  - # some deployment script

```

Any suggestions? @montana any ideas?

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [February 9, 2023, 5:57pm UTC](https://travis-ci.community/t/tcie-enterprise-completley-blocked-cant-push-travis-ci-run-after-success-on-a-specific-branch/13567/2 "2023-02-09T17:57:10Z")

</div>

Hi @howtotalktogirls,

Try using this script in your `TRAVIS_BRANCH` environment variable, make sure you execute this `after_success`:

```yaml
after_success:
- ./deploy.sh

```

Here’s the bash script:

```auto
#!/bin/bash
if ["$TRAVIS_BRANCH" == "prod"]; then
  fi

```

---

<div class="post-metadata">

**Author:** ![howtotalktogirls](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/howtotalktogirls/32/8432_2.png) [@howtotalktogirls](https://travis-ci.community/u/howtotalktogirls)\
**Post date:** [February 9, 2023, 8:00pm UTC](https://travis-ci.community/t/tcie-enterprise-completley-blocked-cant-push-travis-ci-run-after-success-on-a-specific-branch/13567/3 "2023-02-09T20:00:30Z")

</div>

Thank you so much @montana, our whole team has been stalled for an hour and a half. This worked perfectly!
