GitHub v3 REST API

Create a registration token for a repository

Returns a token that you can pass to the config script. The token expires after one hour. You must authenticate
using an access token with the repo scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runners/registration-token

Path Parameters

ownerstringrequired
repostringrequired

Response

201 application/json

Response

Authentication Token

Authentication Token

tokenstringrequired

The token used for authentication

Example:v1.1f699f1069f60xxx

expires_atstring(date-time)required

The time this token expires

Example:2016-07-11T22:14:10Z

permissionsobject

Example:{"issues":"read","deployments":"write"}

repositoriesarray[object]

A git repository

Show Child Parameters
single_filestring | null

Example:config.yaml

repository_selectionstring

Describe whether all repositories have been selected or there’s a selection involved

Allowed values:allselected

post/repos/{owner}/{repo}/actions/runners/registration-token
 
201 application/json

Create a remove token for a repository

Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the repo scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN
post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runners/remove-token

Path Parameters

ownerstringrequired
repostringrequired

Response

201 application/json

Response

Authentication Token

Authentication Token

tokenstringrequired

The token used for authentication

Example:v1.1f699f1069f60xxx

expires_atstring(date-time)required

The time this token expires

Example:2016-07-11T22:14:10Z

permissionsobject

Example:{"issues":"read","deployments":"write"}

repositoriesarray[object]

A git repository

Show Child Parameters
single_filestring | null

Example:config.yaml

repository_selectionstring

Describe whether all repositories have been selected or there’s a selection involved

Allowed values:allselected

post/repos/{owner}/{repo}/actions/runners/remove-token
 
201 application/json

Get a self-hosted runner for a repository

Gets a specific self-hosted runner configured in a repository.

You must authenticate using an access token with the repo scope to use this
endpoint.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runners/{runner_id}

Path Parameters

ownerstringrequired
repostringrequired
runner_idintegerrequired

Unique identifier of the self-hosted runner.

Response

200 application/json

Response

Self hosted runners

A self hosted runner

idintegerrequired

The id of the runner.

Example:5

namestringrequired

The name of the runner.

Example:iMac

osstringrequired

The Operating System of the runner.

Example:macos

statusstringrequired

The status of the runner.

Example:online

busybooleanrequired
labelsarray[object]required

A label for a self hosted runner

Show Child Parameters
get/repos/{owner}/{repo}/actions/runners/{runner_id}
 
200 application/json

Delete a self-hosted runner from a repository

Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the repo
scope to use this endpoint.

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runners/{runner_id}

Path Parameters

ownerstringrequired
repostringrequired
runner_idintegerrequired

Unique identifier of the self-hosted runner.

Response

204

Response

delete/repos/{owner}/{repo}/actions/runners/{runner_id}
 
204

List workflow runs for a repository

Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/runs

Query Parameters

actorstring

Returns someone’s workflow runs. Use the login for the user who created the push associated with the check suite or workflow run.

branchstring

Returns workflow runs associated with a branch. Use the name of the branch of the push.

eventstring

Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see “Events that trigger workflows.”

statusstring

Returns workflow runs with the check run status or conclusion that you specify. For example, a conclusion can be success or a status can be in_progress. Only GitHub can set a status of waiting or requested. For a list of the possible status and conclusion options, see “Create a check run.”

Allowed values:completedaction_requiredcancelledfailureneutralskippedstalesuccesstimed_outin_progressqueuedrequestedwaiting

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

createdstring(date-time)

Returns workflow runs created within the given date-time range. For more information on the syntax, see “Understanding the search syntax.”

exclude_pull_requestsboolean

If true pull requests are omitted from the response (empty array).

Default:false

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

total_countintegerrequired
workflow_runsarray[object]required

An invocation of a workflow

Show Child Parameters
get/repos/{owner}/{repo}/actions/runs
 
200 application/json