title: Variable inside variable gitlab ci
body: <p>Is there a way to use predefined variable inside custom variable in gitlab ci like this:</p>
  <pre><code>before_script:
    - cat &quot;${$CI_COMMIT_REF_NAME}&quot; &gt;&gt; .env
  </code></pre>
  <p>to extract the name of branch from <code>$CI_COMMIT_REF_NAME</code> and use it as a name of custom variable</p>
  <p>Update:</p>
  <p><a href="https://i.stack.imgur.com/aAmWj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aAmWj.png" alt="enter image description here" /></a></p>