title: Trying to parse JSON output in a Github Action
body: <p>I'm trying to extract the value of a HTTP request in a GitHub action and then use that value in another step.</p>
  <p>This is the current code:</p>
  <pre><code>  - run: call some https endpoint
  </code></pre>
  <p>and that returns to the console output:</p>
  <pre><code>{
      &quot;authorizationToken&quot;: &quot;&lt;snip&gt;&quot;,
      &quot;expiration&quot;: &quot;2021-02-26T18:18:38+00:00&quot;
  }
  </code></pre>
  <p>and I'm trying to extract the <code>authorizationToken</code> value and then use it in the next step, like</p>
  <pre><code>  -name: Get auth token
     run: call some https endpoint
     
    -name: set something which uses the token
     run: set blah --token $token_from_previous_step
  </code></pre>
  <strike>
  Now, I couldn't even get the value of the authentication Token extracted from the json output using the `jq` program:
  <pre><code>~  - run: call some https endpoint | echo &quot;jq '.authorizationToken'&quot;~
  </code></pre>
  <p>which errors with:</p>
  <pre><code>jq '.authorizationToken'
  Exception ignored in: &lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='utf-8'&gt;
  BrokenPipeError: [Errno 32] Broken pipe
  </code></pre>
  </strike>
  <p>I'm now able to extract the key/value .. but not sure how to set it as an environment variable, to be used in other steps.</p>
  <p>This works:</p>
  <pre><code>    - run: call some https endpoint &gt; at.json
      - run: jq '.authorizationToken' at.json
  </code></pre>
  <p>so that get the json output from that https endpoint result and saves the result into a file called <code>at.json</code> (which is the json text, above).</p>
  <p>Next, I then run the <code>jq</code> command, extracting the <code>authorizationToken</code> value. which works!</p>
  <p>Now I need to set this value as a env-var. <a href="https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable" rel="nofollow noreferrer">Reading the docs on this, it looks like it can be done</a>, but I'm not sure how to call <code>jq</code> and set the key/value into an env-var.</p>
  <p>I feel like I need to do something like this:</p>
  <pre><code>    - run: echo &quot;AUTH_TOKEN=run the jq command here&quot; &gt;&gt; $GITHUB_ENV
  </code></pre>
  <p>Something like this (which totally fails):</p>
  <pre><code>    - run: echo &quot;AUTH_TOKEN=${{ jq '.authorizationToken' at.json }}&quot; &gt;&gt; $GITHUB_ENV
  </code></pre>