| title | Customizing GitHub-hosted runners | ||||||
|---|---|---|---|---|---|---|---|
| intro | You can install additional software on GitHub-hosted runners as a part of your workflow. | ||||||
| versions |
|
||||||
| type | tutorial | ||||||
| topics |
|
||||||
| shortTitle | Customize runners | ||||||
| redirect_from |
|
{% data reusables.actions.enterprise-github-hosted-runners %}
If you require additional software packages on {% data variables.product.prodname_dotcom %}-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, see AUTOTITLE.
This guide demonstrates how to create a job that installs additional software on a {% data variables.product.prodname_dotcom %}-hosted runner.
The following example demonstrates how to install an apt package as part of a job.
name: Build on Ubuntu
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: {% data reusables.actions.action-checkout %}
- name: Install jq tool
run: |
sudo apt-get update
sudo apt-get install jqNote
Always run sudo apt-get update before installing a package. In case the apt index is stale, this command fetches and re-indexes any available packages, which helps prevent package installation failures.
The following example demonstrates how to install Brew packages and casks as part of a job.
name: Build on macOS
on: push
jobs:
build:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: {% data reusables.actions.action-checkout %}
- name: Install GitHub CLI
run: |
brew update
brew install gh
- name: Install Microsoft Edge
run: |
brew update
brew install --cask microsoft-edgeThe following example demonstrates how to use Chocolatey to install the {% data variables.product.prodname_dotcom %} CLI as part of a job.
{% raw %}
name: Build on Windows
on: push
jobs:
build:
runs-on: windows-latest
steps:
- run: choco install gh
- run: gh version{% endraw %}