title: Error when trying to pass variables between jobs using artifacts
body: <p>I have the fallowing CI parent pipeline and I used artifacts in order to pass variables to a child pipeline:</p>
  <pre><code>before-script:
    script:
      - terraform --version
      - export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
      - export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
      - export TF_VAR_API_KEY=${TF_VAR_API_KEY}
      - export GIT_TOKEN=${GIT_TOKEN}
  
  prepare-infra-code:
    stage: build
    script:
      - cd iac/
      - terraform init -force-copy -backend-config=&quot;address=https://gitlab.com/api/v4/projects/XXX/terraform/state/main&quot; -backend-config=&quot;lock_address=https://gitlab.com/api/v4/projects/XX/terraform/state/main/lock&quot; -backend-config=&quot;unlock_address=https://gitlab.com/api/v4/projects/XXX/terraform/state/main/lock&quot; -backend-config=&quot;username=XXX&quot; -backend-config=&quot;password=$GIT_TOKEN&quot; -backend-config=&quot;lock_method=POST&quot; -backend-config=&quot;unlock_method=DELETE&quot; -backend-config=&quot;retry_wait_min=5&quot;
      - terraform plan   
   ...
  deploy-prod:
    stage: deploy
    script:
      - cd iac/
      - terraform init -force-copy -backend-config=&quot;address=https://gitlab.com/api/v4/projects/XXX/terraform/state/main&quot; -backend-config=&quot;lock_address=https://gitlab.com/api/v4/projects/XXX/terraform/state/main/lock&quot; -backend-config=&quot;unlock_address=https://gitlab.com/api/v4/projects/XXX/terraform/state/main/lock&quot; -backend-config=&quot;username=XXX&quot; -backend-config=&quot;password=$GIT_TOKEN&quot; -backend-config=&quot;lock_method=POST&quot; -backend-config=&quot;unlock_method=DELETE&quot; -backend-config=&quot;retry_wait_min=5&quot;
      - terraform apply --auto-approve
      - URL=$(terraform output api_url | cut -c2- | sed 's/.$//')
      - S3=$(terraform output bucket_name | cut -c2- | sed 's/.$//')
      - echo &quot;REACT_APP_PORTFOLIO_API=$URL/portfolio&quot; &gt;&gt; deploy-prod.env
      - echo &quot;REACT_APP_TRANSACTION_API=$URL/transaction&quot; &gt;&gt; deploy-prod.env
      - echo &quot;FRONTEND_BUCKET=$S3&quot; &gt;&gt; deploy-prod.env
    artifacts:
      reports:
        - dotenv: infra.env
  </code></pre>
  <p>However, I keep getting this error:</p>
  <pre><code>jobs:deploy-prod:artifacts reports should be a hash
  </code></pre>
  <p>Can someone please help me identify the issue ?</p>