Configuring a job that runs on a self-hosted runner
Similarly to GitHub-hosted runners, self-hosted runners use the runs-on
key within a workflow file. Therefore, you will use a line like the following one in your .yml
file:
runs-on: [self-hosted, macOS, dev-runner]
Self-hosted runners automatically receive a self-hosted
label, as well as a label to indicate the operating system and architecture you selected when you were creating a self-hosted runner on your repository's Settings page. In the previous example, macOS
is the label automatically generated for the operating system. An architecture label is not being used in this case. Note how dev-runner
, a label created using the ./config.sh
script, was also used.
The following example is of a workflow used in Chapter 3, A Closer Look at Workflows, to translate issues and issue comments that were written in a language different from English, and this workflow ran on a GitHub-hosted runner. The following code snippet shows...