githubgithub-actionsgithub-for-windowsgithub-actions-self-hosted-runners

Remove default labels on GitHub self hosted runner


When creating a new self-hosted runner for GitHub (enterprise), some default labels (Windows, X64, self-hosted) are automatically added. I can also add custom labels with the --labels parameter.

The thing is that I would like to reserve this runner for some specific workflows, but without restricting the repositories where it can be called. Because some projects use this default labels to choose runner, I would like to remove them.

I tried to find where this labels are created, but I'm fearing they are created server-side and that I would not have control over them...

Did anybody deal with a similar situation?

Thank you.


Solution

  • The support for not adding default labels to self-hosted runners, was added in this PR:

    https://github.com/actions/runner/pull/2443

    It should become available in the next stable release that includes this change.

    To use it, pass in:

    --no-default-labels 
    

    to the config.sh script, when configuring the self hosted runner. Opting out of the default labels makes the --labels option, mandatory.