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

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type