# "env" section of uploaded pipeline does not apply to "command" section

**URL:** https://forum.buildkite.community/t/env-section-of-uploaded-pipeline-does-not-apply-to-command-section/721
**Category:** General
**Created:** [October 3, 2019, 2:31pm UTC](https://forum.buildkite.community/t/env-section-of-uploaded-pipeline-does-not-apply-to-command-section/721 "2019-10-03T14:31:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dan-embark](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dan-embark](https://forum.buildkite.community/u/dan-embark)
#### Post date: [October 3, 2019, 2:31pm UTC](https://forum.buildkite.community/t/env-section-of-uploaded-pipeline-does-not-apply-to-command-section/721/1 "2019-10-03T14:31:18Z")

</div>

I have a build pipeline which executes a script that creates and uploads a pipeline.

This is what it uploads:

> steps:
> 
> - commands:
> - echo “PERFORCE\_DATACL=${PERFORCE\_DATACL}”
> - echo “PERFORCE\_DATADESCRIPTION=${PERFORCE\_DATADESCRIPTION}”
> - echo “GIT\_COMMIT\_BRANCH=${GIT\_COMMIT\_BRANCH}”
> - echo “GIT\_COMMIT\_SHA=${GIT\_COMMIT\_SHA}”
> - echo “GIT\_COMMIT\_DESCRIPTION=${GIT\_COMMIT\_DESCRIPTION}”  
> plugins:
> - thedyrt/skip-checkout#v0.1.1: ~  
> agents:
> - “queue=ue4-gcp”  
> env:  
> PERFORCE\_DATACL: “1234”  
> PERFORCE\_DATADESCRIPTION: “2019/10/03 by [xxx@xxx] ‘xxxxxx’”  
> GIT\_COMMIT\_SHA: “3aaee6245c5059e6b295ac0ba6f92da88a956496”  
> GIT\_COMMIT\_DESCRIPTION: “Fixing xxxxxx”  
> GIT\_COMMIT\_BRANCH: “yyyy”

I would expect that when the commands execute it would pick up the ‘env’ section but it does not, the output for the commands is this:

> “PERFORCE\_DATACL=”  
> “PERFORCE\_DATADESCRIPTION=”  
> “GIT\_COMMIT\_BRANCH=”  
> “GIT\_COMMIT\_SHA=”  
> “GIT\_COMMIT\_DESCRIPTION=”

I was expecting this:

> “PERFORCE\_DATACL=1234”  
> “PERFORCE\_DATADESCRIPTION=2019/10/03 by [xxx@xxx] ‘xxxxxx’”  
> “GIT\_COMMIT\_BRANCH=yyyy”  
> “GIT\_COMMIT\_SHA=3aaee6245c5059e6b295ac0ba6f92da88a956496”  
> “GIT\_COMMIT\_DESCRIPTION=Fixing xxxxxx”

This runs on a windows build agent if that is of interest…

---

<div class="post-metadata">

### Author: ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)
#### Post date: [October 28, 2019, 3:48pm UTC](https://forum.buildkite.community/t/env-section-of-uploaded-pipeline-does-not-apply-to-command-section/721/2 "2019-10-28T15:48:42Z")

</div>

Looks like the indentation is off. env should be at the same level as commands, and the items under it, indented as well.

Here is an example:

```auto
  - label: ":ubuntu: Ubuntu 18.04 - Package Builder"
    command:
      - "buildkite-agent artifact download build.tar.gz . --step ':ubuntu: Ubuntu 18.04 - Build' --agent-access-token \$\$BUILDKITE_AGENT_ACCESS_TOKEN && tar -xzf build.tar.gz"
      - "./.cicd/package.sh"
    env:
      IMAGE_TAG: "ubuntu-18.04"
      BUILDKITE_AGENT_ACCESS_TOKEN:
      OS: "ubuntu-18.04" # OS and PKGTYPE required for lambdas
      PKGTYPE: "deb"

```
