27

I have a Self-Hosted Github Actions runner running on my server for 1 of my repositories. But now I want to use that same runner for an other repo.

Is there a way that I can reuse that same Github Actions runner for an other repo without the need of creating a new runner?

Mike Brouwer
  • 443
  • 1
  • 5
  • 7

4 Answers4

17

Update:

This is possible as of 22nd of April 2020. You can now share runners across an organization. This allows for repositories within your organization to use those runners.

https://github.blog/2020-04-22-github-actions-community-momentum-enterprise-capabilities-and-developer-improvements/#share-self-hosted-runners-across-an-organization

Old Answer:

This is not possible as of yet, according to a Github Partner:

Currently, we have no methods to use the self-hosted runners across repositories, and also have no options to added self-hosted runners on Organization level.

Source: https://github.community/t5/GitHub-Actions/Can-one-Github-Actions-self-hosted-runner-work-for-multiple/td-p/41465

Steven
  • 1,052
  • 17
  • 30
7

For those that want to know what I did to fix this problem. I installed multiple GitHub runners on my server with different names. Not the best solution, but the only thing thats possible now without a dirty workaround...

Mike Brouwer
  • 443
  • 1
  • 5
  • 7
  • Honestly, not a terrible way to do it. If your repositories are exclusive, in that you can have multiple runners running concurrently and not have any conflicts (e.g. node, yarn, bundler, etc.) then I *think* this is the only way to do it. If you want/need the runner to only run job at a time (for either repository) then the best way would be to set it up as an Organization Runner and have it server multiple repositories. Please correct me if I'm wrong! :) – Joshua Pinter Nov 12 '21 at 00:12
5

We're using auto-scaled self-hosted github action runners on AWS spot instances.

We've open-sourced it: https://github.com/philips-labs/terraform-aws-github-runner

One of its creators make a blog post about it with some information about the workings: https://040code.github.io/2020/05/25/scaling-selfhosted-action-runners

Once a runner is active it can pick up multiple builds from various repositories. After a while, the idle runners are terminated. When a new workflow is triggered, a github app will create a new runner and that runner will pick up the work.

JeroenKnoops
  • 373
  • 1
  • 3
  • 10
3

Now the organization account can create a github runner and use it in all repositories.

enter image description here

  • 1
    is there any way for someone to do this with a personal account? I am a one man army and I have my own self-hosted runners! – Luke Pighetti May 02 '23 at 01:17
  • @LukePighetti if you are a one man army then the organization level action runner with Default group should serve you well. As there's no permission issue in that case. – vilicvane Jun 03 '23 at 09:36