title: How do you reuse a before_script from a shared yml file in Gitlab CI?
body: <p>I know that you can reuse blocks of code in a before script using yaml anchors:</p>
  
  <pre><code>.something_before: &amp;something_before
  - echo 'something before'   
  
  
  before_script:
    - *something_before
    - echo "Another script step"
  </code></pre>
  
  <p>but this doesn't seem to work when the .something_before is declared in a shared <code>.yml</code> file via the <code>include:file</code>. It also does not seem that <code>extends</code> works for <code>before_script</code>. Does anyone know a way of reusing some steps in a <code>before_script</code> from a shared <code>.yml</code> file?</p>
  
  <p>EDIT: My use case is that I have 2 gitlab projects with almost identical before_script steps. I don't want to have to change both projects whenever there's a change, so I have a third, separate Gitlab project that has a .yml template that I am including via include:file in both projects. I want to put all the common code in that shared template, and just have like two lines before_script for the git project that has the two extra steps.</p>