Skip to content

ENV vars are missing from actions context #26866

Answered by weide-zhou
Troush asked this question in Actions
Discussion options

You must be logged in to vote

Hi @Troush,

Glad to see you in Github Community Forum!

The step level env only works in that step where it defines, it will not be added into GITHUB_CONTEXT.
But you can find it in ‘env’ setting, and use $varname to invoke it.

To add env to Github Context in step, please use “set-env” command:

    - name: add env var to github context
      run: |
          echo "::set-env name=action_state::yellow"
    - name: Dump env context for check
      env:
        ENV_CONTEXT: ${{ toJson(env) }}
      run: |
         echo "$ENV_CONTEXT"

Thanks

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@eguenou
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants