Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
GitHub Docs

Using GitHub-hosted runners

You can assign a job to run on a virtual machine hosted by GitHub.

Using a GitHub-hosted runner

To use a GitHub-hosted runner, create a job and useruns-on to specify the type of runner that will process the job, such asubuntu-latest,windows-latest, ormacos-latest. For the full list of runner types, seeGitHub-hosted runners reference. If you haverepo: write access to a repository, you can view a list of the runners available to use in workflows in the repository. For more information, seeViewing available runners for a repository.

When 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.

The following diagram demonstrates how two jobs in a workflow are executed on two different GitHub-hosted runners.

Diagram of a workflow that consists of two jobs. One job runs on Ubuntu and the other runs on Windows.

The following example workflow has two jobs, namedRun-npm-on-Ubuntu andRun-PSScriptAnalyzer-on-Windows. When this workflow is triggered, GitHub provisions a new virtual machine for each job.

  • The job namedRun-npm-on-Ubuntu is executed on a Linux VM, because the job'sruns-on: specifiesubuntu-latest.
  • The job namedRun-PSScriptAnalyzer-on-Windows is executed on a Windows VM, because the job'sruns-on: specifieswindows-latest.
YAML
name:Runcommandsondifferentoperatingsystemson:push:branches: [main ]pull_request:branches: [main ]jobs:Run-npm-on-Ubuntu:name:RunnpmonUbunturuns-on:ubuntu-lateststeps:-uses:actions/checkout@v4-uses:actions/setup-node@v4with:node-version:'14'-run:npmhelpRun-PSScriptAnalyzer-on-Windows:name:RunPSScriptAnalyzeronWindowsruns-on:windows-lateststeps:-uses:actions/checkout@v4-name:InstallPSScriptAnalyzermoduleshell:pwshrun:|          Set-PSRepository PSGallery -InstallationPolicy Trusted          Install-Module PSScriptAnalyzer -ErrorAction Stop-name:Getlistofrulesshell:pwshrun:|          Get-ScriptAnalyzerRule

While the job runs, the logs and output can be viewed in the GitHub UI:

Screenshot of a workflow run. The steps for the "Run PSScriptAnalyzer on Windows" job are displayed.

The GitHub Actions runner application is open source. You can contribute and file issues in therunner repository.

Viewing available runners for a repository

If you haverepo: write access to a repository, you can view a list of the runners available to the repository.

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Screenshot of the tabs for the "github/docs" repository. The "Actions" tab is highlighted with an orange outline.

  3. In the left sidebar, under the "Management" section, click Runners.

  4. Review the list of available GitHub-hosted runners for the repository.

  5. Optionally, to copy a runner's label to use it in a workflow, click to the right of the runner, then clickCopy label.

Note

Enterprise and organization owners can create runners from this page. To create a new runner, clickNew runner at the top right of the list of runners to add runners to the repository.

For more information, seeManaging larger runners andAdding self-hosted runners.


[8]ページ先頭

©2009-2025 Movatter.jp