Fetching Runner and Environment data while an action is executing

In a GitHub action, is it possible to fetch/read the information about the environment and the runner? i.e. when a workflow starts, I see the following information, and I would like to use some of them in my action (to resolve the ticket vcpkg failing on macOS · Issue #69 · lukka/run-vcpkg · GitHub)

Starting: Set up job
Current runner version: '2.275.1'
##[group]Operating System
Mac OS X
10.15.7
 19H15
 ##[endgroup]
 ##[group]Virtual Environment
 Environment: macos-10.15
 Version: 20201212.1
 Included Software: https://github.com/actions/virtual-environments/blob/macOS-
1 Like

There are a few related requests to expose runner metadata:

What’s currently exposed is the OS (RUNNER_OS environment variable), but without version number. I also found the undocumented env var ImageOS that is apparently set to ubuntu20 for ubuntu-latest runners. Other than that, you will have to resort to OS-specific commands to find out OS information, but the runner info seems inaccessible at this point.