Self-Hosted Runners
Use the runs-on frontmatter field to target a self-hosted runner instead of the default ubuntu-latest.
runs-on formats
Section titled “runs-on formats”String — single runner label:
---on: issuesruns-on: self-hosted---Array — runner must have all listed labels (logical AND):
---on: issuesruns-on: [self-hosted, linux, x64]---Object — named runner group, optionally filtered by labels:
---on: issuesruns-on: group: my-runner-group labels: [linux, x64]---Sharing configuration via imports
Section titled “Sharing configuration via imports”runs-on must be set in each workflow — it is not merged from imports. Other settings like network and tools can be shared:
---network: allowed: - defaults - private-registry.example.comtools: bash: {}------on: issuesimports: - shared/runner-config.mdruns-on: [self-hosted, linux, x64]---
Triage this issue.Configuring the detection job runner
Section titled “Configuring the detection job runner”When threat detection is enabled, the detection job runs on the agent job’s runner by default. Override it with safe-outputs.threat-detection.runs-on:
---on: issuesruns-on: [self-hosted, linux, x64]safe-outputs: create-issue: {} threat-detection: runs-on: ubuntu-latest---This is useful when your self-hosted runner lacks outbound internet access for AI detection, or when you want to run the detection job on a cheaper runner.
Related documentation
Section titled “Related documentation”- Frontmatter —
runs-onsyntax reference - Imports — importable fields and merge semantics
- Threat Detection — detection job configuration
- Network Access — configuring outbound network permissions
- Sandbox — container and Docker requirements