How to alias environment variable in Github Actions

Hi,

I am trying to inject GITHUB_WORKSPACE value into another step environment variable to no avail.
I have tried:

    env:
        MY_ENV: ${{ env.GITHUB_WORKSPACE }}

and

    env:
        MY_ENV: $GITHUB_WORKSPACE

… to no avail.

Is there a way to do this?

I just tried, the env context doesn’t seem to work there. Specifically for GITHUB_WORKSPACE you have an alternative by using the github context:

    env:
        MY_ENV: ${{ github.workspace }}
2 Likes