Access runner.name
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I want to access the name of the runner executing an action.
From runner-context I want to access:
runner.namerunner.osrunner.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.
Code Snipped
So for a JavaScript / TypeScript action my-action running from workflow
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".
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"
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
- @actions/core: 1.10.1
- Node.js: 20.10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The request concerns @actions/core and the platform-helper capabilities referenced in the issue; start by reading the linked runner-context documentation and related platform-helper issue. Done means making runner.name, runner.os, and runner.arch available to JavaScript/TypeScript actions, including the matrix example, with suitable coverage in the affected package.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100