Github actions invalid environment variables

Hi,

I’m trying to set a curl response as an environment variable using the instructions on this page.

Specifically, there’s a bit of example code that says:

steps:
  - name: Set the value
    id: step_one
    run: |
      echo 'JSON_RESPONSE<<EOF' >> $GITHUB_ENV
      curl https://httpbin.org/json >> $GITHUB_ENV
      echo 'EOF' >> $GITHUB_ENV

I am using the exact same code except for the curl URL. When I do just the curl command on it’s own it’s working as expected, however when I run the whole thing I get the errors

Error: Unable to process file command ‘env’ successfully.
Error: Invalid environment variable value. Matching delimiter not found ‘EOF’

Is there something else I need to do to get this working?