Access self hosted environment variables

I am running a workflow file on GitHub and self hosted runner. To differentiate between GitHub or self hosted runner, I understand the best way is add a environment variable in self hosted runner(as mentioned here)

In my windows machine, I added a new system environment variable ‘SELFHOSTED’ with value as true. How can I access this variable in workflow file?

Is there any other effective way to differentiate between self and GitHub hosted runners?

Might help.