# Env: false breaks job

**URL:** <https://travis-ci.community/t/env-false-breaks-job/4208>\
**Category:** Travis CI Discussions & Feedback\
**Tags:** travis-build\
**Created:** [July 14, 2019, 1:35am UTC](https://travis-ci.community/t/env-false-breaks-job/4208 "2019-07-14T01:35:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [July 14, 2019, 1:35am UTC](https://travis-ci.community/t/env-false-breaks-job/4208/1 "2019-07-14T01:35:06Z")

</div>

When there is an `env:` matrix at the top level, `jobs: include:` get one of the env variables (the first?) in the matrix. It seems unhelpful to do this.  
e.g. Lint job in [https://travis-ci.org/jayvdb/moban/builds/558230993](https://travis-ci.org/jayvdb/moban/builds/558230993)

Preventing that behaviour requires adding `env: {}`, as `env: false` causes the job to be broken.  
e.g. [https://travis-ci.org/jayvdb/moban/builds/558316189](https://travis-ci.org/jayvdb/moban/builds/558316189)  
`foo: false` works for everything else.

c.f. [https://github.com/travis-ci/docs-travis-ci-com/issues/2422](https://github.com/travis-ci/docs-travis-ci-com/issues/2422) for `install: true` in the docs, when `install: false` would be better.

---

<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 14, 2019, 2:42am UTC](https://travis-ci.community/t/env-false-breaks-job/4208/2 "2019-07-14T02:42:21Z")

</div>

[`false` is a boolean](https://stackoverflow.com/questions/42283732/are-on-and-off-supposed-to-be-interpreted-as-true-or-false-in-yaml-1-2) while `env:` is supposed to be a list (or a string).

[You can specify an empty `env:`](https://travis-ci.org/travis-ci/travis-build/builds/552914301/config) to inhibit inheritance.

* * *

As to why `include:` jobs inherit the first entry of the build matrix, that’s something only @BanzaiMan or someone else from Travis staff can answer.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [July 14, 2019, 3:17am UTC](https://travis-ci.community/t/env-false-breaks-job/4208/3 "2019-07-14T03:17:42Z")

</div>

As you point out, `env` is a matrix axis which will be expanded to create a set of jobs to which `jobs.include` will _add_ jobs. These additional jobs must also have `env` values set, but obviously they cannot have an array value for its `env` value, since it is obviously a wrong thing to do. (Not having any value _might_ work, but I’m afraid that changing the behavior may break many existing builds at this point.)

This behavior is explained in [https://docs.travis-ci.com/user/customizing-the-build/#explicitly-included-jobs-inherit-the-first-value-in-the-array](https://docs.travis-ci.com/user/customizing-the-build/#explicitly-included-jobs-inherit-the-first-value-in-the-array)

`env: false` not working is regrettable, though logically consistent. That being said, working around this input seems reasonable.
