Open AnHeuermann opened 8 months ago
I want to access the name of the runner executing an action. From runner-context I want to access:
runner.name
runner.os
runner.arch
For runner.os and runner.arch I can implement alternatives, but I couldn't find a way to get runner.name.
My motivation is to give artifacts unique names that are recognizable by adding the runner name to them.
So for a JavaScript / TypeScript action my-action running from workflow
my-action
jobs: test: strategy: matrix: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: username/my-action
I want to get "ubuntu-latest" and "windows-latest".
"ubuntu-latest"
"windows-latest"
const core = require('@actions/core'); console.log(core.runner.name) // "ubuntu-latest" console.log(core.runner.os) // "Ubuntu 22.04.3 LTS" or similar console.log(core.runner.arch) // "x64"
Similar to https://github.com/actions/toolkit/issues/599, but I only need runner context information. Similar to capabilities documented in https://github.com/actions/toolkit/tree/main/packages/core#platform-helper, but that one isn't defined: https://github.com/actions/toolkit/issues/1630.
Description
I want to access the name of the runner executing an action. From runner-context I want to access:
runner.name
runner.os
runner.arch
For
runner.os
andrunner.arch
I can implement alternatives, but I couldn't find a way to getrunner.name
.My motivation is to give artifacts unique names that are recognizable by adding the runner name to them.
Code Snipped
So for a JavaScript / TypeScript action
my-action
running from workflowI want to get
"ubuntu-latest"
and"windows-latest"
.Additional information
Similar to https://github.com/actions/toolkit/issues/599, but I only need runner context information. Similar to capabilities documented in https://github.com/actions/toolkit/tree/main/packages/core#platform-helper, but that one isn't defined: https://github.com/actions/toolkit/issues/1630.
Versions 'n' stuff