https://github.com/embedded-community/get-runner-labels-action
Github Action to get current runner labels
https://github.com/embedded-community/get-runner-labels-action
github-actions self-hosted-runner
Last synced: 11 months ago
JSON representation
Github Action to get current runner labels
- Host: GitHub
- URL: https://github.com/embedded-community/get-runner-labels-action
- Owner: embedded-community
- License: mit
- Created: 2023-10-20T19:41:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-17T18:19:50.000Z (about 2 years ago)
- Last Synced: 2023-12-17T21:28:23.584Z (about 2 years ago)
- Topics: github-actions, self-hosted-runner
- Language: JavaScript
- Homepage:
- Size: 333 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/embedded-community/get-runner-labels-action/actions/workflows/ci.yml)
# get-runner-labels-action
Github Action to get current runner labels. This is mostly useful for self-hosted runners.
## Why?
Github Actions does not provide a way to get the labels for the current runner.
This action provides a way to get the labels for the current runner.
See [this issue](https://github.com/actions/runner/issues/821) for more information.
**NOTE:** After above issue is resolved, this action will be deprecated.
# Inputs
## `include-org-runners`
By default, this action will include all runners in the organization and all runners in the current repository.
If you want to limit the runners to only those in the current repository, set this to `false`.
**NOTE**: see [github-token](#github-token)
## `github-token`
by default, this action require token with `admin:org` and `self-hosted runners` -scope to get
all runners in the organization level.
# outputs
## `labels`
A comma separated list of labels for the current runner.
## Usage
```yaml
name: Get runner labels
on: [push]
jobs:
get-runner-labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: embedded-community/get-runner-labels-action@v1
id: runner-labels
with:
github-token: ${{ secrets.MY_TOKEN }}
- run: echo ${{ steps.runner-labels.outputs.labels }}
```