Nested environmental variables in github actions

Viewed 36

I'm using github actions and trying to create an environmental variable of a path using the $USER system environmental variable.

This is my yml file:

env:
  MY_PATH: "/Users/$USER/myDir/"

jobs:
  run_tests:
    runs-on: ubuntu-latest

    steps:
      - name: echo path
        run: echo "$MY_PATH"

What is printed is:

/Users/$USER/myDir/

The expected was:

/Users/MyUserName/myDir/

Is there a way to make use of the $USER, $HOME etc. in a way that the script will expand them to the text they hold?

0 Answers
Related