Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 914
Jorge Avatar asked Oct 15 '25 04:10

Jorge


2 Answers

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.

like image 153
Gabriel Samfira Avatar answered Oct 18 '25 20:10

Gabriel Samfira


You cannot remove the default labels. If this runner is meant to be used exclusively by specific repos, then move them into a Runner Group and only allow that groups to be used by those repos.

No other way to configure that at the moment.

like image 36
Rob Bos Avatar answered Oct 18 '25 20:10

Rob Bos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!