Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access runner.name #1681

Open
AnHeuermann opened this issue Mar 5, 2024 · 0 comments
Open

Access runner.name #1681

AnHeuermann opened this issue Mar 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@AnHeuermann
Copy link

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 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 #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: #1630.

Versions 'n' stuff

  • @actions/core: 1.10.1
  • Node.js: 20.10
@AnHeuermann AnHeuermann added the enhancement New feature or request label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant