|
| 1 | +--- |
| 2 | +name: Create a GitHub-hosted runner for an organization |
| 3 | +example: octokit.rest.actions.createHostedRunnerForOrg({ org, name, image, size, runner_group_id }) |
| 4 | +route: POST /orgs/{org}/actions/hosted-runners |
| 5 | +scope: actions |
| 6 | +type: API method |
| 7 | +--- |
| 8 | + |
| 9 | +# Create a GitHub-hosted runner for an organization |
| 10 | + |
| 11 | +Creates a GitHub-hosted runner for an organization. |
| 12 | +OAuth tokens and personal access tokens (classic) need the `manage_runners:org` scope to use this endpoint. |
| 13 | + |
| 14 | +```js |
| 15 | +octokit.rest.actions.createHostedRunnerForOrg({ |
| 16 | + org, |
| 17 | + name, |
| 18 | + image, |
| 19 | + size, |
| 20 | + runner_group_id, |
| 21 | +}); |
| 22 | +``` |
| 23 | + |
| 24 | +## Parameters |
| 25 | + |
| 26 | +<table> |
| 27 | + <thead> |
| 28 | + <tr> |
| 29 | + <th>name</th> |
| 30 | + <th>required</th> |
| 31 | + <th>description</th> |
| 32 | + </tr> |
| 33 | + </thead> |
| 34 | + <tbody> |
| 35 | + <tr><td>org</td><td>yes</td><td> |
| 36 | + |
| 37 | +The organization name. The name is not case sensitive. |
| 38 | + |
| 39 | +</td></tr> |
| 40 | +<tr><td>name</td><td>yes</td><td> |
| 41 | + |
| 42 | +Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '\_'. |
| 43 | + |
| 44 | +</td></tr> |
| 45 | +<tr><td>image</td><td>yes</td><td> |
| 46 | + |
| 47 | +The image of runner. To list all available images, use `GET /actions/hosted-runners/images/github-owned` or `GET /actions/hosted-runners/images/partner`. |
| 48 | + |
| 49 | +</td></tr> |
| 50 | +<tr><td>image.id</td><td>no</td><td> |
| 51 | + |
| 52 | +The unique identifier of the runner image. |
| 53 | + |
| 54 | +</td></tr> |
| 55 | +<tr><td>image.source</td><td>no</td><td> |
| 56 | + |
| 57 | +The source of the runner image. |
| 58 | + |
| 59 | +</td></tr> |
| 60 | +<tr><td>size</td><td>yes</td><td> |
| 61 | + |
| 62 | +The machine size of the runner. To list available sizes, use `GET actions/hosted-runners/machine-sizes` |
| 63 | + |
| 64 | +</td></tr> |
| 65 | +<tr><td>runner_group_id</td><td>yes</td><td> |
| 66 | + |
| 67 | +The existing runner group to add this runner to. |
| 68 | + |
| 69 | +</td></tr> |
| 70 | +<tr><td>maximum_runners</td><td>no</td><td> |
| 71 | + |
| 72 | +The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost. |
| 73 | + |
| 74 | +</td></tr> |
| 75 | +<tr><td>enable_static_ip</td><td>no</td><td> |
| 76 | + |
| 77 | +Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use `GET actions/hosted-runners/limits` |
| 78 | + |
| 79 | +</td></tr> |
| 80 | + </tbody> |
| 81 | +</table> |
| 82 | + |
| 83 | +See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization). |
0 commit comments