title: How do I set an env var with a bash expression in GitHub Actions?
body: <p>In GitHub Actions, I'd like to evaluate a bash expression and then assign it to an environment variable:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>    - name: Tag image
        env:
          GITHUB_SHA_SHORT: ${{ $(echo $GITHUB_SHA | cut -c 1-6) }}
        ..do other things...
  </code></pre>
  
  <p>However, this naive attempt has failed. <a href="https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#literals" rel="noreferrer">According to the docs</a> this doesn't seem to be supported; a somewhat clean workaround would be fine.</p>