Setup environment variable with export command

I am not sure if this is even possible is it? If it is, how do I change this to work?

- run: export CR_PAT=GITHUB_CONTAINER_REGISTRY_PAT
- run: echo ${{ env.CR_PAT }}

this didn’t seem to be valid either:

- run: export CR_PAT=GITHUB_CONTAINER_REGISTRY_PAT
- run: echo ${CR_PAT}

Error: Error: Cannot perform an interactive login from a non TTY device

The problem is that each run step gets its own shell instance, so the export doesn’t carry over. To set an environment variable for the rest of the job you need to use the set-env workflow command:

- run: echo "::set-env name=CR_PAT::GITHUB_CONTAINER_REGISTRY_PAT"

After that either of the references should work. Or, if you need CR_PAT only in that one step you could use an env property for the step:

- run: echo ${CR_PAT}
  env:
    CR_PAT: GITHUB_CONTAINER_REGISTRY_PAT