Customizing GitHub-hosted runners
You can install additional software on GitHub-hosted runners as a part of your workflow.
In this article
If you require additional software packages on GitHub-hosted runners, you can create a job that installs the packages as part of your workflow.
To see which packages are already installed by default, seeAbout GitHub-hosted runners.
This guide demonstrates how to create a job that installs additional software on a GitHub-hosted runner.
Installing software on Ubuntu runners
The following example demonstrates how to install anapt
package as part of a job.
name:BuildonUbuntuon:pushjobs:build:runs-on:ubuntu-lateststeps:-name:Checkoutrepositorycodeuses:actions/checkout@v4-name:Installjqtoolrun:| sudo apt-get update sudo apt-get install jq
Note
Always runsudo apt-get update
before installing a package. In case theapt
index is stale, this command fetches and re-indexes any available packages, which helps prevent package installation failures.
Installing software on macOS runners
The following example demonstrates how to install Brew packages and casks as part of a job.
name:BuildonmacOSon:pushjobs:build:runs-on:macos-lateststeps:-name:Checkoutrepositorycodeuses:actions/checkout@v4-name:InstallGitHubCLIrun:| brew update brew install gh-name:InstallMicrosoftEdgerun:| brew update brew install --cask microsoft-edge
Installing software on Windows runners
The following example demonstrates how to useChocolatey to install the GitHub CLI as part of a job.
name:BuildonWindowson:pushjobs:build:runs-on:windows-lateststeps:-run:chocoinstallgh-run:ghversion