{"meta":{"title":"Using GitHub-hosted runners","intro":"You can assign a job to run on a virtual machine hosted by GitHub.","product":"GitHub Actions","breadcrumbs":[{"href":"/en/actions","title":"GitHub Actions"},{"href":"/en/actions/how-tos","title":"How-tos"},{"href":"/en/actions/how-tos/manage-runners","title":"Manage runners"},{"href":"/en/actions/how-tos/manage-runners/github-hosted-runners","title":"GitHub-hosted runners"},{"href":"/en/actions/how-tos/manage-runners/github-hosted-runners/use-github-hosted-runners","title":"Use GitHub-hosted runners"}],"documentType":"article"},"body":"# Using GitHub-hosted runners\n\nYou can assign a job to run on a virtual machine hosted by GitHub.\n\n## Using a GitHub-hosted runner\n\nTo use a GitHub-hosted runner, create a job and use `runs-on` to specify the type of runner that will process the job, such as `ubuntu-latest`, `windows-latest`, or `macos-latest`. For the full list of runner types, see [GitHub-hosted runners reference](/en/actions/reference/runners/github-hosted-runners#supported-runners-and-hardware-resources). If you have `repo: write` access to a repository, you can view a list of the runners available to use in workflows in the repository. For more information, see [Viewing available runners for a repository](#viewing-available-runners-for-a-repository).\n\nWhen the job begins, GitHub automatically provisions a new VM for that job. All steps in the job execute on the VM, allowing the steps in that job to share information using the runner's filesystem. You can run workflows directly on the VM or in a Docker container. When the job has finished, the VM is automatically decommissioned.\n\nThe following diagram demonstrates how two jobs in a workflow are executed on two different GitHub-hosted runners.\n\n![Diagram of a workflow that consists of two jobs. One job runs on Ubuntu and the other runs on Windows.](/assets/images/help/actions/overview-github-hosted-runner.png)\n\nThe following example workflow has two jobs, named `Run-npm-on-Ubuntu` and `Run-PSScriptAnalyzer-on-Windows`. When this workflow is triggered, GitHub provisions a new virtual machine for each job.\n\n* The job named `Run-npm-on-Ubuntu` is executed on a Linux VM, because the job's `runs-on:` specifies `ubuntu-latest`.\n* The job named `Run-PSScriptAnalyzer-on-Windows` is executed on a Windows VM, because the job's `runs-on:` specifies `windows-latest`.\n\n```yaml copy\nname: Run commands on different operating systems\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\njobs:\n  Run-npm-on-Ubuntu:\n    name: Run npm on Ubuntu\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-node@v7\n        with:\n          node-version: '14'\n      - run: npm help\n\n  Run-PSScriptAnalyzer-on-Windows:\n    name: Run PSScriptAnalyzer on Windows\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@v6\n      - name: Install PSScriptAnalyzer module\n        shell: pwsh\n        run: |\n          Set-PSRepository PSGallery -InstallationPolicy Trusted\n          Install-Module PSScriptAnalyzer -ErrorAction Stop\n      - name: Get list of rules\n        shell: pwsh\n        run: |\n          Get-ScriptAnalyzerRule\n```\n\nWhile the job runs, the logs and output can be viewed in the GitHub UI:\n\n![Screenshot of a workflow run. The steps for the \"Run PSScriptAnalyzer on Windows\" job are displayed.](/assets/images/help/repository/actions-runner-output.png)\n\nThe GitHub Actions runner application is open source. You can contribute and file issues in the [runner](https://github.com/actions/runner) repository.\n\n## Viewing available runners for a repository\n\nIf you have `repo: write` access to a repository, you can view a list of the runners available to the repository.\n\n1. On GitHub, navigate to the main page of the repository.\n2. Under your repository name, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-play\" aria-label=\"play\" role=\"img\"><path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z\"></path></svg> Actions**.\n\n   ![Screenshot of the tabs for the \"github/docs\" repository. The \"Actions\" tab is highlighted with an orange outline.](/assets/images/help/repository/actions-tab-global-nav-update.png)\n3. In the left sidebar, under the \"Management\" section, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-server\" aria-label=\"server\" role=\"img\"><path d=\"M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z\"></path></svg> Runners**.\n4. Review the list of available GitHub-hosted runners for the repository.\n5. Optionally, to copy a runner's label to use it in a workflow, click <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-kebab-horizontal\" aria-label=\"More options\" role=\"img\"><path d=\"M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\"></path></svg> to the right of the runner, then click **Copy label**.\n\n> \\[!NOTE]\n> Enterprise and organization owners can create runners from this page. To create a new runner, click **New runner** at the top right of the list of runners to add runners to the repository.\n>\n> For more information, see [Managing larger runners](/en/actions/how-tos/manage-runners/larger-runners/manage-larger-runners) and [Adding self-hosted runners](/en/actions/how-tos/manage-runners/self-hosted-runners/add-runners)."}