GitHub v3 REST API

Set GitHub Actions permissions for a repository

Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.

If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as allowed_actions to selected actions, then you cannot override them for the repository.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

put
http://HOSTNAME/api/v3/repos/{owner}/{repo}/actions/permissions

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json
enabledbooleanrequired

Whether GitHub Actions is enabled on the repository.

allowed_actionsstring

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

Allowed values:alllocal_onlyselected

Response

204

Response

put/repos/{owner}/{repo}/actions/permissions

Body

{ "enabled": true, "allowed_actions": "selected" }
 
204

Get allowed actions for a repository

Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see “Set GitHub Actions permissions for a repository.”

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/actions/permissions/selected-actions

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

selected-actions

github_owned_allowedbooleanrequired

Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.

patterns_allowedarray[string]required

Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."

get/repos/{owner}/{repo}/actions/permissions/selected-actions
 
200 application/json

Set allowed actions for a repository

Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see “Set GitHub Actions permissions for a repository.”

If the repository belongs to an organization or enterprise that has selected actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.

To use the patterns_allowed setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

put
http://HOSTNAME/api/v3/repos/{owner}/{repo}/actions/permissions/selected-actions

Path Parameters

ownerstringrequired
repostringrequired

Body

application/json

selected-actions

github_owned_allowedbooleanrequired

Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.

patterns_allowedarray[string]required

Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."

Response

204

Response

put/repos/{owner}/{repo}/actions/permissions/selected-actions

Body

{ "github_owned_allowed": true, "verified_allowed": false, "patterns_allowed": [ "monalisa/octocat@*", "docker/*" ] }
 
204

List self-hosted runners for a repository

Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo scope to use this endpoint.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/actions/runners

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

total_countintegerrequired
runnersarray[object]required

A self hosted runner

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

List runner applications for a repository

Lists binaries for the runner application that you can download and run.

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

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/actions/runners/downloads

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

Runner Application

osstringrequired
architecturestringrequired
download_urlstringrequired
filenamestringrequired
temp_download_tokenstring

A short lived bearer token used to download the runner, if needed.

sha256_checksumstring
get/repos/{owner}/{repo}/actions/runners/downloads
 
200 application/json