Github variable $GITHUB_WORKSPACE vs ${{ github.workspace }}

I was using $GITHUB_WORKSPACE in my yaml as shown below:-

- name: build dotnet
        run: |
            cd $GITHUB_WORKSPACE
     

While it does work, it is recommended to use ${{ github.workspace }} variable instead.

- name: build dotnet
        run: |
            cd ${{ github.workspace }}
     

Apparently, $GITHUB_WORKSPACE is used and maintained for backward compatibility reasons.

Full list of the environment variables is being defined here.  As stated here, we have a proper way to use the environment variables in our workflow.






Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm