Search code examples
githubgithub-actions

How to add more local runners to Actions?


I added one local runner to an organization under my GitHub account (it was recognized by the organization upon connection) and then wanted to add a second one (so that both can be used in parallel builds).

I chose again "Add new" and was brought to the same page explaining step by step what to do. The token in the run command was different but despite this I get

github-runner@srv:~$ ./config.sh --url https://github.com/MYORG --token XXX

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------
Cannot configure the runner because it is already configured. To reconfigure the runner, run 'config.cmd remove' or './config.sh remove' first.

The token is the new one, different from the first installation (that worked fine).

How can I add a second (and more) local runners?


Solution

  • The token is the new one...

    Yes, but the token is being ignored, because you have already configured the runner:

    Cannot configure the runner because it is already configured.

    The configuration for the runner exists in the directory that it's running in (and a lot of other state, like the actual build directories). Each runner needs independent state.

    Unzip the runner into a different directory and try again.

    (From your prompt, it looks like you're doing this all in your home directory? Don't do that. Create some directories somewhere for each of these runner instances to live.)