Skip to content

Question about expression context parsing #26337

Discussion options

You must be logged in to vote

$MYVAR is Bash (and generally Unix shell) syntax. ${{ env.MYVAR }} is Github actions syntax. So you can use the former wherever you have a shell, which is in the run part of steps (unless you set another interpreter, or run on Windows).

And for creating environment variables, see Setting an environment variable. 😉 In short, you can do something like

echo "MYVAR=VALUE" >> $GITHUB_ENV

which writes the variable to a special file, and the Actions runner makes sure it’s available in subsequent steps. And you can of course build that definition dynamically.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants