Skip to main content

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

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, named Run-npm-on-Ubuntu and Run-PSScriptAnalyzer-on-Windows. When this workflow is triggered, GitHub provisions a new virtual machine for each job.

  • The job named Run-npm-on-Ubuntu is executed on a Linux VM, because the job's runs-on: specifies ubuntu-latest.
  • The job named Run-PSScriptAnalyzer-on-Windows is executed on a Windows VM, because the job's runs-on: specifies windows-latest.
YAML
name: Run commands on different operating systems
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  Run-npm-on-Ubuntu:
    name: Run npm on Ubuntu
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '14'
      - run: npm help

  Run-PSScriptAnalyzer-on-Windows:
    name: Run PSScriptAnalyzer on Windows
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install PSScriptAnalyzer module
        shell: pwsh
        run: |
          Set-PSRepository PSGallery -InstallationPolicy Trusted
          Install-Module PSScriptAnalyzer -ErrorAction Stop
      - name: Get list of rules
        shell: pwsh
        run: |
          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.

GitHub Actions 실행기 애플리케이션이 오픈 소스입니다. 실행기 리포지토리에서 기여하고 문제를 제출할 수 있습니다.

Viewing available runners for a repository

리포지토리에 repo: write 액세스 권한이 있는 경우 리포지토리에서 사용할 수 있는 실행기 목록을 볼 수 있습니다.

  1. GitHub에서 리포지토리의 기본 페이지로 이동합니다.

  2. 리포지토리 이름 아래에서 작업을 클릭합니다.

    "github/docs" 리포지토리의 탭 스크린샷. "작업" 탭은 주황색 윤곽선으로 강조 표시됩니다.

  3. 왼쪽 사이드바의 "관리" 섹션에서 실행기를 클릭합니다.

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

  5. 실행기 레이블을 복사사하여 워크플로에서 사용하려면, 실행기 오른쪽에 있는 을 클릭한 다음 레이블 복사를 클릭합니다.

참고 항목

엔터프라이즈와 조직 소유자 및 “조직 실행기와 실행기 그룹 관리” 권한을 가진 사용자는 이 페이지에서 새 실행기를 만들 수 있습니다. 새 실행기를 만들려면 실행기 목록의 오른쪽 상단에 있는 새 실행기를 클릭하여 리포지토리에 실행기를 추가합니다.

자세한 내용은 대형 실행기 관리하기자체 호스트형 실행기 추가를 참조하세요. 사용자 지정 조직 역할에 대한 자세한 내용은 사용자 지정 조직 역할 소개를 참조하세요.