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

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…

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:

  - 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"