Posting this here so the problem and resolution are googleable.
I’ve created a public template repository in an organization and configured a self-hosted runner for that organization. I then created a very simple workflow in that repository with
Unfortunately, the workflow failed with the following error message:
No runner matching the specified labels was found: self-hosted.
However, both the repository’s and the organization’s settings displayed that the runner is available and tagged with
self-hosted. In the repository’s settings, it’s displayed in the “Runners shared with this repository” section:
As it turns out, not only GitHub Actions warns that using self-hosted runners in public repositories is dangerous, it’s actually disabled by default.
If you go to organization’s settings, there is an ellipsis next to each runner group. It gets you to a group edit dialog, which has the “Allow public repositories” checkbox, unchecked by default.
Unfortunately, it looks like it only means that a runner in such group is not visible to GitHub Actions workflow in the repository (which causes the “no runner … was found” error), but is still visible in settings with no indication.
Hopefully, a clearer error message or some indication in repository’s settings will be added at some point.