I have a question regarding Add Runner/Runner installation. When I Add a runner for Example: select Windows(64bit) for System and Architecture, I see Runner labels comes "self.hosted" and "windows".
Question1: It is not allowed to delete these default labels. Is it actual behaviour or any way to delete any one runner from these two?
When I run the pipeline and passing
runs-on:
- self.hosted
- windows
It is working.
Question2: When I keep both Its working and when I delete "windows" and kept "self.hosted", It gives error "no runner is active" even my window runner is on. But when I have put only "windows" as runner It works. Is it the behaviour?
Question 3:
How operating system is getting detect. If I have 2 steps and in one step I am taking
runs-on:
- self.hosted
- windows
means with runs-on and trying get OS type by using windows command, It is giving me proper result. and in second step I am not passing any runner. when I am trying to execute
- OS_TYPE=$(uname -s)
- echo "Detected OS- $OS_TYPE"
It gives me "Linux".
Not able to understand in second step how It is getting operating system?
Question 4-
I have a scenario when I am not passing anything through runs-on then we are considering it as cloud runner. So, In this case how a system will understand which command to execute If Its window/linux/mac. Please suggest. As per my understanding It will run only linux command . So in case of windows cloud - how can I manage?
Please check those scenarios and give me some solution. I am getting stuck because of this clarification.
To answer your questions:
Question 1:
When you add a self-hosted runner (e.g., Windows 64-bit), it is automatically assigned the labels:
self.hosted
windows
These labels are default and required for the runner to be discoverable and selectable by jobs.
You cannot remove these default labels. They are enforced by the system to ensure correct runner targeting and OS matching.
You can add custom labels, but the system labels (self.hosted, windows, etc.) are not removable.
References:
Question 2:
The runner selection is based on label matching.
If you specify:
runs-on:
- self.hosted
- windowsThe job will run on any runner that has both labels (in this case any Windows runners you configure).
If you specify only self.hosted, the system looks for any self-hosted runner, regardless of OS. If your only available runner is Windows, but the job expects a generic self-hosted runner, it may not match due to additional internal constraints (e.g., job requirements, shell type).
If you specify only windows, it will match any runner labeled windows (including both self-hosted and cloud runners, if available).
If you remove "windows" and keep only "self.hosted", and your runner is Windows, it should still match—but if your pipeline or job requires a specific shell or OS, it may fail if the runner doesn't meet those requirements.
Both labels are required for precise targeting.
If you want to target a Windows self-hosted runner, you must use both labels.
Question 3:
Question 4:
runs-on:
- self.hosted
- windows
Hope this helps!
Cheers!
- Ben (Bitbucket Cloud Support)
Thanks @Ben Thanks, Its really helpful. Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.