How to choose runners with `label1` **or** `label2`?

Hello!

If I indicate

runs-on: [label1, label2]

for a job, then GitHub Actions will look for runners with label1 and label2. What if I would like a runner with label1 or label2? Thank you.


Update (December 17, 2021)
Sorry, it seems that the original question is not specific enough. Here is a more specific version.

I hope to run a job on either GitHub-hosted runners with a label ubuntu-latest or on self-hosted runners with a label foo. How should I specify runs-on?

It seems that my question is not interesting to anyone … :sweat_smile:

have two runners:

  • label1,label1-label2
  • label2,label1-label2

Have your workflow use:

runs-on: [label1-label2]

Thank you very much for your reply!

Maybe I should make my question more specific: I hope to run a job on either GitHub-hosted runners with a label ubuntu-latest or on self-hosted runners with a label foo. How should I specify runs-on?

I suppose that there is no way to change the labels for the GitHub-hosted runners.

Thank you.

Required . The type of machine to run the job on. The machine can be either a GitHub-hosted runner or a self-hosted runner. You can provide runs-on as a single string or as an array of strings.

I’m fairly confident what you’re asking for isn’t supported. But, why would you do it?

The pricing models for these two things are sufficiently different that I can’t imagine why I’d want to do this. (We do have self-hosted runners and have other things that run on GitHub hosted runners.)

If you can provide a good enough reason for why you’d want this, I’d encourage you to ask
https://support.github.com

for the feature (explain your Use Case – if it’s sufficiently compelling, maybe they’ll consider it).

Thank you for the information.

I have a bunch of jobs, each of which takes one or two hours to run. Both GitHub-hosted runners and self-hosted runners are capable of running them. I hope to see the results as soon as possible, while money is a less important factor to consider (indeed, since my project is public, the GitHub Actions are for free; but even if it is charged, I care more about time).

If I use only GitHub-hosted runners, queuing will take a long time (hours); I can use self-hosted runners, but I do not have som many machines available, so we will also see jobs queuing for hours. If I can use both GitHub-hosted runners and self-hosted runners, then the queuing time will be significantly reduced, possibly to ZERO.

Is this a reasonable scenario? Thanks.

1 Like

Makes enough sense. Personally, for things that GitHub can run, unless I had some specific reason to need to use a self-hosted (or really thought I could run it cheaper), I’d just pay GitHub to run them.

Switching from Free to Pro would double your runner capacity (and to Teams) would triple it:

(We’re paying for Teams.)

1 Like

Thank you for your suggestion. Upgrading my account may be a solution.