# Using TRAVIS\_COMMIT\_RANGE for a conditional stage prevents stage from ever running

**URL:** <https://travis-ci.community/t/using-travis-commit-range-for-a-conditional-stage-prevents-stage-from-ever-running/1307>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [December 7, 2018, 6:59pm UTC](https://travis-ci.community/t/using-travis-commit-range-for-a-conditional-stage-prevents-stage-from-ever-running/1307 "2018-12-07T18:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonkarns](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jasonkarns/32/708_2.png) [@jasonkarns](https://travis-ci.community/u/jasonkarns)\
**Post date:** [December 7, 2018, 6:59pm UTC](https://travis-ci.community/t/using-travis-commit-range-for-a-conditional-stage-prevents-stage-from-ever-running/1307/1 "2018-12-07T18:59:15Z")

</div>

I have a second stage that I would like to run on some of my builds, after the default test stage. The script for this stage requires the commit range for the PR. As such, I have the stage configured to be conditional on the presence of the `TRAVIS_COMMIT_RANGE` env var.

```auto
jobs:
  include:
    - stage: test
    - stage: verify definitions
      if: env(TRAVIS_COMMIT_RANGE) is present
      script: npm run verify-definitions -- $TRAVIS_COMMIT_RANGE

```

When my travis.yml is configured as above, the verification stage \_never gets triggered.

When I remove the conditional, then the stage runs as expected (it runs successfully on PR builds, but fails as expected on push builds because the push build doesn’t have the requisite TRAVIS\_COMMIT\_RANGE env var).

Why is this conditional never evaluating to true and forcing the verification stage to run on PR builds?
