You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have an environment variable in my workflow:
env:
TESTVAR: helloworld
In a specific run step, it seems I can do either:
- name: Echo via shell
run: echo $TESTVAR
- name: Echo via env context
run: echo ${{ env.TESTVAR }}
Is there a pro/con to either approach? Any limitations?
We have a lot of jobs that run on different platforms, and constantly switch between $TESTVAR and $env:TESTVAR on Linux and Windows. The context syntax seems a little more consistent but wondering if there are any downsides.
One difference I've noticed is that in the workflow run log when the step command is echoed for shell syntax, it is not yet expanded.
ActionsBuild, test, and automate your deployment pipeline with world-class CI/CDQuestion
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Select Topic Area
Question
Body
Let's say I have an environment variable in my workflow:
In a specific run step, it seems I can do either:
Is there a pro/con to either approach? Any limitations?
We have a lot of jobs that run on different platforms, and constantly switch between
$TESTVAR
and$env:TESTVAR
on Linux and Windows. The context syntax seems a little more consistent but wondering if there are any downsides.One difference I've noticed is that in the workflow run log when the step command is echoed for shell syntax, it is not yet expanded.
Beta Was this translation helpful? Give feedback.
All reactions