title: YAML merge level
body: <p>We have a gitlab-ci yaml file with duplicate parts.</p>
  
  <pre><code>test:client:
    before_script:
      - node -v
      - yarn install
    cache:
      untracked: true
      key: client
      paths:
        - node_modules/
    script:
      - npm test
  
  build:client:
    before_script:
      - node -v
      - yarn install
    cache:
      untracked: true
      key: client
      paths:
        - node_modules/
      policy: pull
    script:
      - npm build
  </code></pre>
  
  <p>I would like to know, with the merge syntax, if I can extract the common part to reuse it efficiently in the context of these two parts.</p>
  
  <pre><code>.node_install_common: &amp;node_install_common
    before_script:
      - node -v
      - yarn install
    cache:
      untracked: true
      key: client
      paths:
        - node_modules/
  </code></pre>
  
  <p>But the real question is: <strong>at which indent level do I have to merge the block to ensure policy: pull is applied to the cache section</strong>. I tried to so that:</p>
  
  <pre><code>test:client:
    &lt;&lt;: *node_install_common
    script:
      - npm test
  
  test:build:
    &lt;&lt;: *node_install_common
      policy: pull
    script:
      - npm build
  </code></pre>
  
  <p>But I get an invalid yaml error. How to indent to get the correct merge behavior?</p>