Can I get GH actions runner vm version in workflow?

I want to get an actions runner VM version like below.

I want to purge the actions cache when the VM version is changed to resolve problems like this.

However, I couldn’t find a way to get the version from github contexts.

Do you know the way to get it?

It’s not exposed, but others have asked for it too, e.g. Expose runner version in the runner context

As a workaround, you could try to query the Actions API to retrieve the log of the Set up job to get at this information.