Display which runner is used by a workflow

Is there a way to figure out which runner is used to execute a workflow?

This would be very usefull especially for self hosted runner.

Thank you very much.

I’m not familiar with custom runners, but I once dumped the environment variables for one of the windows runners, and I found a variable called  RUNNER_TRACKING_ID. I’m not sure if this is useful

You can see the run here as well as all the other environment variables that were defined:

https://github.com/Actions-R-Us/default-env/runs/351472092

There isn’t a direct way to show runner name or IP . But you could run a command to list all environment variables, ant then find some information from the env values.

For example in window runner, you could run set command in cmd to show environment variables.  

   - run: set

     shell: cmd   

RUNNER_WOKESPACE shows the action runner located path, in my case USERNAME is the computer name . Then I could figure out where the runner is installed.

Update: 

You could run hostname command , it will show computer name which installs the self-hosted runner . And in Run set step, in environment variables list, you could see COMPUTERNAME . 

 

thank you very much, this helps me alot