Github actions invalid environment variables


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:

  - name: Set the value
    id: step_one
    run: |
      curl >> $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?