How to choose runner based on name?

I have added two self hosted runners.
Both with same default labels.

But, I want my job to pickup based on name instead of label.

I tried by using that as below.

runs-on: DevBuild1

But it is not picking and just stuck in waiting status.

Hi @ukreddy-erwin ,

Self-hosted runners have the self-hosted label. Using only this label will select any self-hosted runner. To select runners that meet certain criteria, such as operating system or architecture, we recommend providing an array of labels that begins with self-hosted (this must be listed first) and then includes additional labels as needed. When you specify an array of labels, jobs will be queued on runners that have all the labels that you specify.

Although the self-hosted label is not required, we strongly recommend specifying it when using self-hosted runners to ensure that your job does not unintentionally specify any current or future GitHub-hosted runners. For more details, please see this doc.

Just give each runner a label that matches their name (DevBuild1, DevBuild2) and move on w/ life.

@jsoref yeah doing the same way now :slight_smile:
But, is there any option to use the name instead of label, as there are many nodes like that.

Hi Akash, thanks for the detail. But my question is not related to that. Please check go through it once more

Hi @ukreddy-erwin
As I know there is no other way than labels to assign workflow to a runner.
You can always check the official documentation for runs-on syntax Workflow syntax for GitHub Actions - GitHub Docs as it could be changed in the future.

I can’t think of other ways to assign a runner without using a label. This is something our product team would love to look at. Please submit your feedback via the new GitHub Feedback Discussions forum so that our product team can better track your request :slight_smile:. It’s a new thing, but we’re trying to push all product feedback to the same new area so it’s easier to find and consolidate user feedback!

yeah, opened this as per your suggestion How to choose runner based on name? · Discussion #17380 · github/feedback · GitHub

1 Like

Hey all, spoke about this with the Actions Senior Product Manager in our latest AMA over on Twitch yesterday.

The workaround we talked about for now was to just use labels, like you’re already doing! Next steps to request this feature be considered still would be to create a thread in the feedback discussions, which I see you’ve also already done! :sparkles: