GitHub Actions の支払いを管理する GitHubは、macOSランナーのホストにMacStadiumを使用しています。
特定の種類のセルフホストランナーにジョブをまわすためのラベルの利用方法に関する情報については、「ワークフロー内でのセルフホストランナーの利用」を参照してください。
A self-hosted runner can be located in either your repository, organization, or enterprise account settings on GitHub. セルフホストランナーを管理するには、セルフホストランナーが追加された場所に応じて以下の権限が必要になります。
-
User repository: You must be the repository owner.
-
Organization: You must be an organization owner.
-
Organization repository: You must be an organization owner, or have admin access to the repository.
-
Enterprise account: You must be an enterprise owner.
カスタムラベルの作成
-
Navigate to where your self-hosted runner is registered:
- In an organization or repository: navigate to the main page and click Settings.
- If using an enterprise account: navigate to your enterprise account by visiting
https://github.com/enterprises/ENTERPRISE-NAME, replacingENTERPRISE-NAMEwith your enterprise account's name. In the enterprise sidebar, Policies.
-
Navigate to the GitHub Actions settings:
-
In an organization or repository: click Actions in the left sidebar.

-
If using an enterprise account: click Actions under " Policies".
-
-
Locate the list of runners under "Self-hosted runners".
-
If your runner is in a group, locate the runner group and click to view the list of runners.

-
Locate the runner you want to update, and click to view the label selection menu. このメニューは、セルフホストランナーで利用できるすべてのカスタムラベルを表示します。 セルフホストランナーに割り当て済みのラベルには、隣にが表示されます。

-
"Filter labels(フィルターラベル)"フィールドで、新しいラベルの名前を入力し、Create new label(新しいラベルの作成) をクリックしてください。

カスタムラベルが作成され、セルフホストランナーに割り当てられます。 カスタムラベルをセルフホストランナーから取り除くことはできますが、現在はラベルを手動で削除することはできません。 ランナーに割り当てられていない、未使用のラベルは、24時間以内に自動的に削除されます。
セルフホストランナーへのラベルの割り当て
-
Navigate to where your self-hosted runner is registered:
- In an organization or repository: navigate to the main page and click Settings.
- If using an enterprise account: navigate to your enterprise account by visiting
https://github.com/enterprises/ENTERPRISE-NAME, replacingENTERPRISE-NAMEwith your enterprise account's name. In the enterprise sidebar, Policies.
-
Navigate to the GitHub Actions settings:
-
In an organization or repository: click Actions in the left sidebar.

-
If using an enterprise account: click Actions under " Policies".
-
-
Locate the list of runners under "Self-hosted runners".
-
If your runner is in a group, locate the runner group and click to view the list of runners.

-
Locate the runner you want to update, and click to view the label selection menu. このメニューは、セルフホストランナーで利用できるすべてのカスタムラベルを表示します。 セルフホストランナーに割り当て済みのラベルには、隣にが表示されます。

-
ラベルをクリックして、セルフホストランナーに割り当ててください。
カスタムラベルのセルフホストランナーからの削除
-
Navigate to where your self-hosted runner is registered:
- In an organization or repository: navigate to the main page and click Settings.
- If using an enterprise account: navigate to your enterprise account by visiting
https://github.com/enterprises/ENTERPRISE-NAME, replacingENTERPRISE-NAMEwith your enterprise account's name. In the enterprise sidebar, Policies.
-
Navigate to the GitHub Actions settings:
-
In an organization or repository: click Actions in the left sidebar.

-
If using an enterprise account: click Actions under " Policies".
-
-
Locate the list of runners under "Self-hosted runners".
-
If your runner is in a group, locate the runner group and click to view the list of runners.

-
Locate the runner you want to update, and click to view the label selection menu. このメニューは、セルフホストランナーで利用できるすべてのカスタムラベルを表示します。 セルフホストランナーに割り当て済みのラベルには、隣にが表示されます。

-
割り当てられているラベルをクリックして、セルフホストランナーから削除してください。 ランナーに割り当てられていない、未使用のラベルは、24時間以内に自動的に削除されます。
設定スクリプトを使ったラベルの作成と割り当て
セルフホストランナー上の設定スクリプトを使い、カスタムラベルの作成と割り当てを行えます。 たとえば、以下のコマンドはgpuというラベルをセルフホストランナーに割り当てます。
./config.sh --labels gpu
このラベルがまだ存在しなければ、作成されます。 このやり方で、x64あるいはlinuxといったデフォルトのラベルをランナーに割り当てることもできます。 デフォルトラベルが設定スクリプトで割り当てられた場合、GitHub Actionsはそれらを指定されたとおりに受け付け、ランナーが実際にそのオペレーティングシステムやアーキテクチャを使っているかは検証しません。
複数のラベルを割り当てるには、カンマ区切りが使えます。 例:
./config.sh --labels gpu,x64,linux
ノート: 既存のランナーを置き換えた場合は、カスタムラベルがあるなら割り当てをしなおさなければなりません。

