# Environment variable that tells whether PR is a draft PR

**URL:** <https://travis-ci.community/t/environment-variable-that-tells-whether-pr-is-a-draft-pr/8768>\
**Category:** Environments\
**Tags:** build-env, github, travis-build\
**Created:** [May 26, 2020, 3:26pm UTC](https://travis-ci.community/t/environment-variable-that-tells-whether-pr-is-a-draft-pr/8768 "2020-05-26T15:26:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![philonor](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/philonor/32/4659_2.png) [@philonor](https://travis-ci.community/u/philonor)\
**Post date:** [May 26, 2020, 3:26pm UTC](https://travis-ci.community/t/environment-variable-that-tells-whether-pr-is-a-draft-pr/8768/1 "2020-05-26T15:26:10Z")

</div>

Hi there,

why isn’t there a environment variable that tells whether the current build is a build belonging to a GitHub Draft Pull Request?  
I would expect a complementary variable TRAVIS\_PULL\_REQUEST\_DRAFT that is “true” if the GitHub PR is in draft mode.  
IMO This is necessary to skip certain build/test stages while in draft mode. E.g., skipping e2e tests to avoid them being run on every WIP commit.

Thanks & best regards

---

<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:** [May 26, 2020, 3:38pm UTC](https://travis-ci.community/t/environment-variable-that-tells-whether-pr-is-a-draft-pr/8768/2 "2020-05-26T15:38:38Z")

</div>

Why would you want to know that?

- You cannot rerun a PR build when the draft mark is removed (unless you push another commit after that), so you want to run the same check regardless of the draft status.

- The build status for every batch of pushed commits is also shown as a mark alongside them in PR UI. The build logic behind those statuses suddenly becoming different at an arbitrary moment will make them misleading.
