Endpoints to manage GitHub Actions using the REST API.

Get GitHub Actions cache usage for an enterprise

get /enterprises/{enterprise}/actions/cache/usage

Gets the total GitHub Actions cache usage for an enterprise. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

enterprise

string

required

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Response

ExamplesSchema

Response

{
  "total_active_caches_size_in_bytes": 3344284,
  "total_active_caches_count": 5
}

Get GitHub Actions cache usage policy for an enterprise

get /enterprises/{enterprise}/actions/cache/usage-policy

Gets the GitHub Actions cache usage policy for an enterprise. You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

enterprise

string

required

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Response

ExamplesSchema

Response

{
  "repo_cache_size_limit_in_gb": 10,
  "max_repo_cache_size_limit_in_gb": 15
}

Set GitHub Actions cache usage policy for an enterprise

patch /enterprises/{enterprise}/actions/cache/usage-policy

Sets the GitHub Actions cache usage policy for an enterprise. You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

repo_cache_size_limit_in_gb

int

For repositories in an enterprise, the default size limit for the sum of all caches in a repository, in gigabytes.

Example
10

max_repo_cache_size_limit_in_gb

int

For repositories in an enterprise, the maximum value that can be set as the limit for the sum of all caches in a repository, in gigabytes.

Example
15

Request

{
  "repo_cache_size_limit_in_gb": 10,
  "max_repo_cache_size_limit_in_gb": 15
}

Response

ExamplesSchema

Response

Empty response

Get default workflow permissions for an enterprise

get /enterprises/{enterprise}/actions/permissions/workflow

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an enterprise, as well as whether GitHub Actions can submit approving pull request reviews. For more information, see "Enforcing a policy for workflow permissions in your enterprise."

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

enterprise

string

required

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Response

ExamplesSchema

Success response

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Set default workflow permissions for an enterprise

put /enterprises/{enterprise}/actions/permissions/workflow

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an enterprise, and sets whether GitHub Actions can submit approving pull request reviews. For more information, see "Enforcing a policy for workflow permissions in your enterprise."

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

default_workflow_permissions

string

The default workflow permissions granted to the GITHUB_TOKEN when running workflows.

Enum
  • read
  • write

can_approve_pull_request_reviews

boolean

Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.

Request

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Response

ExamplesSchema

Success response

Empty response

Get GitHub Actions cache usage for an organization

get /orgs/{org}/actions/cache/usage

Gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_admistration:read permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "total_active_caches_size_in_bytes": 3344284,
  "total_active_caches_count": 5
}

List repositories with GitHub Actions cache usage for an organization

get /orgs/{org}/actions/cache/usage-by-repository

Lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_admistration:read permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "repository_cache_usages": [
    {
      "full_name": "octo-org/Hello-World",
      "active_caches_size_in_bytes": 2322142,
      "active_caches_count": 3
    },
    {
      "full_name": "octo-org/server",
      "active_caches_size_in_bytes": 1022142,
      "active_caches_count": 2
    }
  ]
}

Get GitHub Actions permissions for an organization

get /orgs/{org}/actions/permissions

Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "enabled_repositories": "all",
  "allowed_actions": "selected",
  "selected_actions_url": "https://api.github.com/organizations/42/actions/permissions/selected-actions"
}

Set GitHub Actions permissions for an organization

put /orgs/{org}/actions/permissions

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

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

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

enabled_repositories

string

required

The policy that controls the repositories in the organization that are allowed to run GitHub Actions.

Enum
  • all
  • none
  • selected

allowed_actions

string

The permissions policy that controls the actions that are allowed to run.

Enum
  • all
  • local_only
  • selected

Request

{
  "enabled_repositories": "all",
  "allowed_actions": "selected"
}

Response

ExamplesSchema

Response

Empty response

List selected repositories enabled for GitHub Actions in an organization

get /orgs/{org}/actions/permissions/repositories

Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "repositories": [
    {
      "id": 1296269,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "name": "Hello-World",
      "full_name": "octocat/Hello-World",
      "owner": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/octocat/Hello-World",
      "description": "This your first repo!",
      "fork": false,
      "url": "https://api.github.com/repos/octocat/Hello-World",
      "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
      "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
      "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
      "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
      "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
      "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
      "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
      "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
      "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
      "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
      "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
      "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
      "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
      "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
      "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
      "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
      "git_url": "git:github.com/octocat/Hello-World.git",
      "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
      "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
      "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
      "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
      "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
      "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
      "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
      "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
      "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
      "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
      "ssh_url": "git@github.com:octocat/Hello-World.git",
      "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
      "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
      "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
      "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
      "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
      "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
      "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
      "clone_url": "https://github.com/octocat/Hello-World.git",
      "mirror_url": "git:git.example.com/octocat/Hello-World",
      "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
      "svn_url": "https://svn.github.com/octocat/Hello-World",
      "homepage": "https://github.com",
      "language": null,
      "forks_count": 9,
      "stargazers_count": 80,
      "watchers_count": 80,
      "size": 108,
      "default_branch": "master",
      "open_issues_count": 0,
      "is_template": true,
      "topics": [
        "octocat",
        "atom",
        "electron",
        "api"
      ],
      "has_issues": true,
      "has_projects": true,
      "has_wiki": true,
      "has_pages": false,
      "has_downloads": true,
      "archived": false,
      "disabled": false,
      "visibility": "public",
      "pushed_at": "2011-01-26T19:06:43Z",
      "created_at": "2011-01-26T19:01:12Z",
      "updated_at": "2011-01-26T19:14:43Z",
      "permissions": {
        "admin": false,
        "push": false,
        "pull": true
      },
      "allow_rebase_merge": true,
      "template_repository": null,
      "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
      "allow_squash_merge": true,
      "allow_auto_merge": false,
      "delete_branch_on_merge": true,
      "allow_merge_commit": true,
      "subscribers_count": 42,
      "network_count": 0,
      "license": {
        "key": "mit",
        "name": "MIT License",
        "url": "https://api.github.com/licenses/mit",
        "spdx_id": "MIT",
        "node_id": "MDc6TGljZW5zZW1pdA==",
        "html_url": "https://github.com/licenses/mit"
      },
      "forks": 1,
      "open_issues": 1,
      "watchers": 1
    }
  ]
}

Set selected repositories enabled for GitHub Actions in an organization

put /orgs/{org}/actions/permissions/repositories

Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

selected_repository_ids

array[int]

required

List of repository IDs to enable for GitHub Actions.

Request

{
  "selected_repository_ids": [
    32,
    42
  ]
}

Response

ExamplesSchema

Response

Empty response

Enable a selected repository for GitHub Actions in an organization

put /orgs/{org}/actions/permissions/repositories/{repository_id}

Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

org

string

required

The organization name. The name is not case sensitive.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Response

Empty response

Disable a selected repository for GitHub Actions in an organization

delete /orgs/{org}/actions/permissions/repositories/{repository_id}

Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

org

string

required

The organization name. The name is not case sensitive.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Response

Empty response

Get allowed actions for an organization

get /orgs/{org}/actions/permissions/selected-actions

Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization.""

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

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

Set allowed actions for an organization

put /orgs/{org}/actions/permissions/selected-actions

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

If the organization belongs to an enterprise that has selected actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.

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

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

github_owned_allowed

boolean

required

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

patterns_allowed

array[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/*.

Request

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

Response

ExamplesSchema

Response

Empty response

Get default workflow permissions for an organization

get /orgs/{org}/actions/permissions/workflow

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization, as well as whether GitHub Actions can submit approving pull request reviews. For more information, see "Setting the permissions of the GITHUB_TOKEN for your organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Set default workflow permissions for an organization

put /orgs/{org}/actions/permissions/workflow

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization, and sets if GitHub Actions can submit approving pull request reviews. For more information, see "Setting the permissions of the GITHUB_TOKEN for your organization."

You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.

default_workflow_permissions

string

The default workflow permissions granted to the GITHUB_TOKEN when running workflows.

Enum
  • read
  • write

can_approve_pull_request_reviews

boolean

Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.

Request

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Response

ExamplesSchema

Success response

Empty response

List required workflows

get /orgs/{org}/actions/required_workflows

List all required workflows in an organization.

You must authenticate using an access token with the read:org scope to use this endpoint.

For more information, see "Required Workflows."

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "required_workflows": [
    {
      "id": 30433642,
      "name": "Required CI",
      "path": ".github/workflows/ci.yml",
      "scope": "selected",
      "ref": "refs/head/main",
      "state": "active",
      "selected_repositories_url": "https://api.github.com/organizations/org/actions/required_workflows/1/repositories",
      "created_at": "2020-01-22T19:33:08Z",
      "updated_at": "2020-01-22T19:33:08Z",
      "repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
      }
    },
    {
      "id": 30433643,
      "name": "Required Linter",
      "path": ".github/workflows/lint.yml",
      "scope": "all",
      "ref": "refs/head/main",
      "state": "active",
      "created_at": "2020-01-22T19:33:08Z",
      "updated_at": "2020-01-22T19:33:08Z",
      "repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
      }
    }
  ]
}

Create a required workflow

post /orgs/{org}/actions/required_workflows

Create a required workflow in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

workflow_file_path

string

required

Path of the workflow file to be configured as a required workflow.

repository_id

string

required

The ID of the repository that contains the workflow file.

scope

string

Enable the required workflow for all repositories or selected repositories in the organization.

Default
"all"
Enum
  • selected
  • all

selected_repository_ids

array[int]

A list of repository IDs where you want to enable the required workflow. You can only provide a list of repository ids when the scope is set to selected.

Request

{
  "workflow_file_path": ".github/workflows/ci.yaml",
  "repository_id": 53,
  "scope": "selected",
  "selected_repository_ids": [
    32,
    91
  ]
}

Response

ExamplesSchema

Response

{
  "id": 30433642,
  "name": "Required CI",
  "path": ".github/workflows/ci.yml",
  "scope": "selected",
  "ref": "refs/head/main",
  "state": "active",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/1/repositories",
  "created_at": "2020-01-22T19:33:08Z",
  "updated_at": "2020-01-22T19:33:08Z",
  "repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octocat/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octocat/Hello-World",
    "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octocat/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octocat/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
  }
}

Get a required workflow

get /orgs/{org}/actions/required_workflows/{required_workflow_id}

Get a required workflow configured in an organization.

You must authenticate using an access token with the read:org scope to use this endpoint.

For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

required_workflow_id

int

required

The unique identifier of the required workflow.

Response

ExamplesSchema

Response

{
  "id": 30433642,
  "name": "Required CI",
  "path": ".github/workflows/ci.yml",
  "scope": "selected",
  "ref": "refs/head/main",
  "state": "active",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/1/repositories",
  "created_at": "2020-01-22T19:33:08Z",
  "updated_at": "2020-01-22T19:33:08Z",
  "repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octocat/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octocat/Hello-World",
    "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octocat/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octocat/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
  }
}

Delete a required workflow

delete /orgs/{org}/actions/required_workflows/{required_workflow_id}

Deletes a required workflow configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

required_workflow_id

int

required

The unique identifier of the required workflow.

Response

ExamplesSchema

Response

Empty response

Update a required workflow

patch /orgs/{org}/actions/required_workflows/{required_workflow_id}

Update a required workflow in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

workflow_file_path

string

Path of the workflow file to be configured as a required workflow.

repository_id

string

The ID of the repository that contains the workflow file.

scope

string

Enable the required workflow for all repositories or selected repositories in the organization.

Default
"all"
Enum
  • selected
  • all

selected_repository_ids

array[int]

A list of repository IDs where you want to enable the required workflow. A list of repository IDs where you want to enable the required workflow. You can only provide a list of repository ids when the scope is set to selected.

Request

{
  "workflow_file_path": ".github/workflows/ci.yaml",
  "repository_id": 53,
  "scope": "selected",
  "selected_repository_ids": [
    32,
    91
  ]
}

Response

ExamplesSchema

Response

{
  "id": 30433642,
  "name": "Required CI",
  "path": ".github/workflows/ci.yml",
  "scope": "selected",
  "ref": "refs/head/main",
  "state": "active",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/required_workflows/1/repositories",
  "created_at": "2020-01-22T19:33:08Z",
  "updated_at": "2020-01-22T19:33:08Z",
  "repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octocat/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octocat/Hello-World",
    "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octocat/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octocat/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
  }
}

List selected repositories for a required workflow

get /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories

Lists the selected repositories that are configured for a required workflow in an organization. To use this endpoint, the required workflow must be configured to run on selected repositories.

You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this endpoint.

For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

required_workflow_id

int

required

The unique identifier of the required workflow.

Response

ExamplesSchema

Success

{
  "total_count": 1,
  "repositories": [
    {
      "id": 1296269,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "name": "Hello-World",
      "full_name": "octocat/Hello-World",
      "owner": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/octocat/Hello-World",
      "description": "This your first repo!",
      "fork": false,
      "url": "https://api.github.com/repos/octocat/Hello-World",
      "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
      "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
      "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
      "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
      "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
      "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
      "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
      "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
      "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
      "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
      "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
      "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
      "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
      "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
      "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
      "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
      "git_url": "git:github.com/octocat/Hello-World.git",
      "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
      "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
      "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
      "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
      "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
      "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
      "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
      "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
      "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
      "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
      "ssh_url": "git@github.com:octocat/Hello-World.git",
      "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
      "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
      "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
      "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
      "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
      "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
      "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
      "clone_url": "https://github.com/octocat/Hello-World.git",
      "mirror_url": "git:git.example.com/octocat/Hello-World",
      "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
      "svn_url": "https://svn.github.com/octocat/Hello-World",
      "homepage": "https://github.com",
      "language": null,
      "forks_count": 9,
      "stargazers_count": 80,
      "watchers_count": 80,
      "size": 108,
      "default_branch": "master",
      "open_issues_count": 0,
      "is_template": true,
      "topics": [
        "octocat",
        "atom",
        "electron",
        "api"
      ],
      "has_issues": true,
      "has_projects": true,
      "has_wiki": true,
      "has_pages": false,
      "has_downloads": true,
      "archived": false,
      "disabled": false,
      "visibility": "public",
      "pushed_at": "2011-01-26T19:06:43Z",
      "created_at": "2011-01-26T19:01:12Z",
      "updated_at": "2011-01-26T19:14:43Z",
      "permissions": {
        "admin": false,
        "push": false,
        "pull": true
      },
      "allow_rebase_merge": true,
      "template_repository": null,
      "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
      "allow_squash_merge": true,
      "allow_auto_merge": false,
      "delete_branch_on_merge": true,
      "allow_merge_commit": true,
      "subscribers_count": 42,
      "network_count": 0,
      "license": {
        "key": "mit",
        "name": "MIT License",
        "url": "https://api.github.com/licenses/mit",
        "spdx_id": "MIT",
        "node_id": "MDc6TGljZW5zZW1pdA==",
        "html_url": "https://github.com/licenses/mit"
      },
      "forks": 1,
      "open_issues": 1,
      "watchers": 1
    }
  ]
}

Sets repositories for a required workflow

put /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories

Sets the repositories for a required workflow that is required for selected repositories.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

selected_repository_ids

array[int]

required

The IDs of the repositories for which the workflow should be required.

Request

{
  "selected_repository_ids": [
    32,
    91
  ]
}

Response

ExamplesSchema

Response

Empty response

Add a repository to a required workflow

put /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}

Adds a repository to a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

required_workflow_id

int

required

The unique identifier of the required workflow.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Success

Empty response

Remove a selected repository from required workflow

delete /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}

Removes a repository from a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.

You must authenticate using an access token with the admin:org scope to use this endpoint.

For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

required_workflow_id

int

required

The unique identifier of the required workflow.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Success

Empty response

List self-hosted runner groups for an organization

get /orgs/{org}/actions/runner-groups

Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.

You must authenticate using an access token with the admin:org scope to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

visible_to_repository

string

Only return runner groups that are allowed to be used by this repository.

Response

ExamplesSchema

Response

{
  "total_count": 3,
  "runner_groups": [
    {
      "id": 1,
      "name": "Default",
      "visibility": "all",
      "default": true,
      "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners",
      "inherited": false,
      "allows_public_repositories": true,
      "restricted_to_workflows": false,
      "selected_workflows": [],
      "workflow_restrictions_read_only": false
    },
    {
      "id": 2,
      "name": "octo-runner-group",
      "visibility": "selected",
      "default": false,
      "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories",
      "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
      "inherited": true,
      "allows_public_repositories": true,
      "restricted_to_workflows": true,
      "selected_workflows": [
        "octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
      ],
      "workflow_restrictions_read_only": true
    },
    {
      "id": 3,
      "name": "expensive-hardware",
      "visibility": "private",
      "default": false,
      "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners",
      "inherited": false,
      "allows_public_repositories": true,
      "restricted_to_workflows": false,
      "selected_workflows": [
        "octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
      ],
      "workflow_restrictions_read_only": false
    }
  ]
}

Create a self-hosted runner group for an organization

post /orgs/{org}/actions/runner-groups

Creates a new self-hosted runner group for an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

name

string

required

Name of the runner group.

visibility

string

Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories.

Default
"all"
Enum
  • selected
  • all
  • private

selected_repository_ids

array[int]

List of repository IDs that can access the runner group.

runners

array[int]

List of runner IDs to add to the runner group.

allows_public_repositories

boolean

Whether the runner group can be used by public repositories.

Default
false

restricted_to_workflows

boolean

If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array.

Default
false

selected_workflows

array[string]

List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.

Request

{
  "name": "Expensive hardware runners",
  "visibility": "selected",
  "selected_repository_ids": [
    32,
    91
  ],
  "runners": [
    9,
    2
  ]
}

Response

ExamplesSchema

Response

{
  "id": 2,
  "name": "octo-runner-group",
  "visibility": "selected",
  "default": false,
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories",
  "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
  "inherited": false,
  "allows_public_repositories": true,
  "restricted_to_workflows": true,
  "selected_workflows": [
    "octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
  ],
  "workflow_restrictions_read_only": false
}

Get a self-hosted runner group for an organization

get /orgs/{org}/actions/runner-groups/{runner_group_id}

Gets a specific self-hosted runner group for an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

Response

ExamplesSchema

Response

{
  "id": 2,
  "name": "octo-runner-group",
  "visibility": "selected",
  "default": false,
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories",
  "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
  "inherited": false,
  "allows_public_repositories": true,
  "restricted_to_workflows": true,
  "selected_workflows": [
    "octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
  ],
  "workflow_restrictions_read_only": false
}

Delete a self-hosted runner group from an organization

delete /orgs/{org}/actions/runner-groups/{runner_group_id}

Deletes a self-hosted runner group for an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

Response

ExamplesSchema

Response

Empty response

Update a self-hosted runner group for an organization

patch /orgs/{org}/actions/runner-groups/{runner_group_id}

Updates the name and visibility of a self-hosted runner group in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

name

string

required

Name of the runner group.

visibility

string

Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories.

Enum
  • selected
  • all
  • private

allows_public_repositories

boolean

Whether the runner group can be used by public repositories.

Default
false

restricted_to_workflows

boolean

If true, the runner group will be restricted to running only the workflows specified in the selected_workflows array.

Default
false

selected_workflows

array[string]

List of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.

Request

{
  "name": "Expensive hardware runners",
  "visibility": "selected"
}

Response

ExamplesSchema

Response

{
  "id": 2,
  "name": "octo-runner-group",
  "visibility": "selected",
  "default": false,
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories",
  "runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
  "inherited": false,
  "allows_public_repositories": true,
  "restricted_to_workflows": true,
  "selected_workflows": [
    "octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
  ],
  "workflow_restrictions_read_only": false
}

List repository access to a self-hosted runner group in an organization

get /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories

Lists the repositories with access to a self-hosted runner group configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

page

int

Page number of the results to fetch.

Default
1

per_page

int

The number of results per page (max 100).

Default
30

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "repositories": [
    {
      "id": 1296269,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "name": "Hello-World",
      "full_name": "octocat/Hello-World",
      "owner": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/octocat/Hello-World",
      "description": "This your first repo!",
      "fork": false,
      "url": "https://api.github.com/repos/octocat/Hello-World",
      "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
      "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
      "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
      "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
      "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
      "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
      "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
      "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
      "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
      "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
      "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
      "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
      "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
      "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
      "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
      "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
      "git_url": "git:github.com/octocat/Hello-World.git",
      "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
      "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
      "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
      "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
      "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
      "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
      "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
      "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
      "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
      "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
      "ssh_url": "git@github.com:octocat/Hello-World.git",
      "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
      "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
      "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
      "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
      "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
      "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
      "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
      "clone_url": "https://github.com/octocat/Hello-World.git",
      "mirror_url": "git:git.example.com/octocat/Hello-World",
      "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
      "svn_url": "https://svn.github.com/octocat/Hello-World",
      "homepage": "https://github.com",
      "language": null,
      "forks_count": 9,
      "stargazers_count": 80,
      "watchers_count": 80,
      "size": 108,
      "default_branch": "master",
      "open_issues_count": 0,
      "is_template": true,
      "topics": [
        "octocat",
        "atom",
        "electron",
        "api"
      ],
      "has_issues": true,
      "has_projects": true,
      "has_wiki": true,
      "has_pages": false,
      "has_downloads": true,
      "archived": false,
      "disabled": false,
      "visibility": "public",
      "pushed_at": "2011-01-26T19:06:43Z",
      "created_at": "2011-01-26T19:01:12Z",
      "updated_at": "2011-01-26T19:14:43Z",
      "permissions": {
        "admin": false,
        "push": false,
        "pull": true
      },
      "template_repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "clone_url": "https://github.com/octocat/Hello-World.git",
        "mirror_url": "git:git.example.com/octocat/Hello-World",
        "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
        "svn_url": "https://svn.github.com/octocat/Hello-World",
        "homepage": "https://github.com",
        "organization": null,
        "language": null,
        "forks": 9,
        "forks_count": 9,
        "stargazers_count": 80,
        "watchers_count": 80,
        "watchers": 80,
        "size": 108,
        "default_branch": "master",
        "open_issues": 0,
        "open_issues_count": 0,
        "is_template": true,
        "license": {
          "key": "mit",
          "name": "MIT License",
          "url": "https://api.github.com/licenses/mit",
          "spdx_id": "MIT",
          "node_id": "MDc6TGljZW5zZW1pdA==",
          "html_url": "https://api.github.com/licenses/mit"
        },
        "topics": [
          "octocat",
          "atom",
          "electron",
          "api"
        ],
        "has_issues": true,
        "has_projects": true,
        "has_wiki": true,
        "has_pages": false,
        "has_downloads": true,
        "archived": false,
        "disabled": false,
        "visibility": "public",
        "pushed_at": "2011-01-26T19:06:43Z",
        "created_at": "2011-01-26T19:01:12Z",
        "updated_at": "2011-01-26T19:14:43Z",
        "permissions": {
          "admin": false,
          "push": false,
          "pull": true
        },
        "allow_rebase_merge": true,
        "template_repository": null,
        "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
        "allow_squash_merge": true,
        "allow_auto_merge": false,
        "delete_branch_on_merge": true,
        "allow_merge_commit": true,
        "subscribers_count": 42,
        "network_count": 0
      },
      "temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
      "delete_branch_on_merge": true,
      "subscribers_count": 42,
      "network_count": 0,
      "license": {
        "key": "mit",
        "name": "MIT License",
        "url": "https://api.github.com/licenses/mit",
        "spdx_id": "MIT",
        "node_id": "MDc6TGljZW5zZW1pdA=="
      },
      "forks": 1,
      "open_issues": 1,
      "watchers": 1
    }
  ]
}

Set repository access for a self-hosted runner group in an organization

put /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories

Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

selected_repository_ids

array[int]

required

List of repository IDs that can access the runner group.

Request

{
  "selected_repository_ids": [
    32,
    91
  ]
}

Response

ExamplesSchema

Response

Empty response

Add repository access to a self-hosted runner group in an organization

put /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}

Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see "Create a self-hosted runner group for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Response

Empty response

Remove repository access to a self-hosted runner group in an organization

delete /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}

Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see "Create a self-hosted runner group for an organization."

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

repository_id

int

required

The unique identifier of the repository.

Response

ExamplesSchema

Response

Empty response

List self-hosted runners in a group for an organization

get /orgs/{org}/actions/runner-groups/{runner_group_id}/runners

Lists self-hosted runners that are in a specific organization group.

You must authenticate using an access token with the admin:org scope to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "runners": [
    {
      "id": 23,
      "name": "linux_runner",
      "os": "linux",
      "status": "online",
      "busy": true,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 11,
          "name": "Linux",
          "type": "read-only"
        }
      ]
    },
    {
      "id": 24,
      "name": "mac_runner",
      "os": "macos",
      "status": "offline",
      "busy": false,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 20,
          "name": "macOS",
          "type": "read-only"
        },
        {
          "id": 21,
          "name": "no-gpu",
          "type": "custom"
        }
      ]
    }
  ]
}

Set self-hosted runners in a group for an organization

put /orgs/{org}/actions/runner-groups/{runner_group_id}/runners

Replaces the list of self-hosted runners that are part of an organization runner group.

You must authenticate using an access token with the admin:org scope to use this endpoint.

runners

array[int]

required

List of runner IDs to add to the runner group.

Request

{
  "runners": [
    9,
    2
  ]
}

Response

ExamplesSchema

Response

Empty response

Add a self-hosted runner to a group for an organization

put /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}

Adds a self-hosted runner to a runner group configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

Empty response

Remove a self-hosted runner from a group for an organization

delete /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}

Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_group_id

int

required

Unique identifier of the self-hosted runner group.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

Empty response

List self-hosted runners for an organization

get /orgs/{org}/actions/runners

Lists all self-hosted runners configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "runners": [
    {
      "id": 23,
      "name": "linux_runner",
      "os": "linux",
      "status": "online",
      "busy": true,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 11,
          "name": "Linux",
          "type": "read-only"
        }
      ]
    },
    {
      "id": 24,
      "name": "mac_runner",
      "os": "macos",
      "status": "offline",
      "busy": false,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 20,
          "name": "macOS",
          "type": "read-only"
        },
        {
          "id": 21,
          "name": "no-gpu",
          "type": "custom"
        }
      ]
    }
  ]
}

List runner applications for an organization

get /orgs/{org}/actions/runners/downloads

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

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

[
  {
    "os": "osx",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-osx-x64-2.277.1.tar.gz",
    "filename": "actions-runner-osx-x64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "f1fa173889dc9036cd529417e652e1729e5a3f4d35ec0151806d7480fda6b89b"
  },
  {
    "os": "linux",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-x64-2.277.1.tar.gz",
    "filename": "actions-runner-linux-x64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "02d710fc9e0008e641274bb7da7fde61f7c9aa1cbb541a2990d3450cc88f4e98"
  },
  {
    "os": "linux",
    "architecture": "arm",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-arm-2.277.1.tar.gz",
    "filename": "actions-runner-linux-arm-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIyYTEzZDRmZC01ZDhkLTRjNzgtYjg2MS0zYTMxZGQ3MmYzNjQiLCJzaWQiOiI0MzZiNTg3YS04ODMyLTRiMTMtOWM2Ny05OWRkMjA2ZTQzNmMiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MzE1NzEsImV4cCI6MTYxNzkzNTc3MX0.PMhU7-MOnZRDj5k5a4ieeFlQCmKPl2pQvpVRhGZq-9ByKF5s9G0rsnGBxDcolTYlbvEAmSSkeAEwF486F7P0kMVEb-GI14WbErqqMSyaPL81c3W7UHxMJLaSBnDs9ftHMv_IkJmRzaROS8q1ObzUW-ErlltxCdj2zF_5ruK9G2RR566AOAtiA3AHV6k7-FCY5--sDYJN_YXPgpwI0fPN1TM92fdPm93hJnoXuCJNpBYp1vl5W4gwGtU_Pa07ESdqqFN1YJJHUloedNhiIOczGfGVSapRc8vyGm9P_VCM_yKD8JI-MkOXl8JI5fCfhmjmKsw-vSAh9NW67RGvmehmpw",
    "sha256_checksum": "2f2bda21e2fd8fed6938b33182a293f6b1f74e4c5d09acd6d9a0fe3f979f5c85"
  },
  {
    "os": "win",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-win-x64-2.277.1.zip",
    "filename": "actions-runner-win-x64-2.277.1.zip",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "7215c75a462eeb6a839fa8ed298d79f620617d44d47d37c583114fc3f3b27b30"
  },
  {
    "os": "linux",
    "architecture": "arm64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-arm64-2.277.1.tar.gz",
    "filename": "actions-runner-linux-arm64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "a6aa6dd0ba217118ef2b4ea24e9e0a85b02b13c38052a5de0776d6ced3a79c64"
  }
]

Create a registration token for an organization

post /orgs/{org}/actions/runners/registration-token

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 admin:org 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 --token TOKEN

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
  "expires_at": "2020-01-22T12:13:35.123-08:00"
}

Create a remove token for an organization

post /orgs/{org}/actions/runners/remove-token

Returns a token that you can pass to the config script to remove a self-hosted runner from an organization. The token expires after one hour.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Example using remove token

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

./config.sh remove --token TOKEN

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
  "expires_at": "2020-01-29T12:13:35.123-08:00"
}

Get a self-hosted runner for an organization

get /orgs/{org}/actions/runners/{runner_id}

Gets a specific self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "id": 23,
  "name": "MBP",
  "os": "macos",
  "status": "online",
  "busy": true,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Delete a self-hosted runner from an organization

delete /orgs/{org}/actions/runners/{runner_id}

Forces the removal of a self-hosted runner from an organization. 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 admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

Empty response

List labels for a self-hosted runner for an organization

get /orgs/{org}/actions/runners/{runner_id}/labels

Lists all labels for a self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Add custom labels to a self-hosted runner for an organization

post /orgs/{org}/actions/runners/{runner_id}/labels

Add custom labels to a self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

labels

array[string]

required

The names of the custom labels to add to the runner.

Request

{
  "labels": [
    "gpu",
    "accelerated"
  ]
}

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Set custom labels for a self-hosted runner for an organization

put /orgs/{org}/actions/runners/{runner_id}/labels

Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

labels

array[string]

required

The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.

Request

{
  "labels": [
    "gpu",
    "accelerated"
  ]
}

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Remove all custom labels from a self-hosted runner for an organization

delete /orgs/{org}/actions/runners/{runner_id}/labels

Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "total_count": 3,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    }
  ]
}

Remove a custom label from a self-hosted runner for an organization

delete /orgs/{org}/actions/runners/{runner_id}/labels/{name}

Remove a custom label from a self-hosted runner configured in an organization. Returns the remaining labels from the runner.

This endpoint returns a 404 Not Found status if the custom label is not present on the runner.

You must authenticate using an access token with the admin:org scope to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

name

string

required

The name of a self-hosted runner's custom label.

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

List organization secrets

get /orgs/{org}/actions/secrets

Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 3,
  "secrets": [
    {
      "name": "GIST_ID",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "private"
    },
    {
      "name": "DEPLOY_TOKEN",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "all"
    },
    {
      "name": "GH_TOKEN",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "selected",
      "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories"
    }
  ]
}

Get an organization public key

get /orgs/{org}/actions/secrets/public-key

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "key_id": "012345678912345678",
  "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}

Get an organization secret

get /orgs/{org}/actions/secrets/{secret_name}

Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Response

{
  "name": "GH_TOKEN",
  "created_at": "2019-08-10T14:59:22Z",
  "updated_at": "2020-01-10T14:59:22Z",
  "visibility": "selected",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories"
}

Create or update an organization secret

put /orgs/{org}/actions/secrets/{secret_name}

Creates or updates an organization secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the libsodium-wrappers library.

const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
  // Convert Secret & Base64 key to Uint8Array.
  let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
  let binsec = sodium.from_string(secret)

  //Encrypt the secret using LibSodium
  let encBytes = sodium.crypto_box_seal(binsec, binkey)

  // Convert encrypted Uint8Array to Base64
  let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

  console.log(output)
});

Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public

def encrypt(public_key: str, secret_value: str) -> str:
  """Encrypt a Unicode string using the public key."""
  public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
  sealed_box = public.SealedBox(public_key)
  encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
  return b64encode(encrypted).decode("utf-8")

Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");

var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);

Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));

Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"

key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)

box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")

# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)

encrypted_value

string

^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$

Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an organization public key endpoint.

key_id

string

ID of the key you used to encrypt the secret.

visibility

string

required

Which type of organization repositories have access to the organization secret. selected means only the repositories specified by selected_repository_ids can access the secret.

Enum
  • all
  • private
  • selected

selected_repository_ids

array[int]

An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can manage the list of selected repositories using the List selected repositories for an organization secret, Set selected repositories for an organization secret, and Remove selected repository from an organization secret endpoints.

Request

{
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678",
  "visibility": "selected",
  "selected_repository_ids": [
    1296269,
    1296280
  ]
}

Response

ExamplesSchema

Response when creating a secret

null

Delete an organization secret

delete /orgs/{org}/actions/secrets/{secret_name}

Deletes a secret in an organization using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Response

Empty response

List selected repositories for an organization secret

get /orgs/{org}/actions/secrets/{secret_name}/repositories

Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

page

int

Page number of the results to fetch.

Default
1

per_page

int

The number of results per page (max 100).

Default
30

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "repositories": [
    {
      "id": 1296269,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "name": "Hello-World",
      "full_name": "octocat/Hello-World",
      "owner": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/octocat/Hello-World",
      "description": "This your first repo!",
      "fork": false,
      "url": "https://api.github.com/repos/octocat/Hello-World",
      "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
      "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
      "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
      "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
      "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
      "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
      "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
      "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
      "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
      "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
      "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
      "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
      "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
      "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
      "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
      "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
      "git_url": "git:github.com/octocat/Hello-World.git",
      "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
      "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
      "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
      "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
      "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
      "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
      "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
      "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
      "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
      "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
      "ssh_url": "git@github.com:octocat/Hello-World.git",
      "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
      "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
      "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
      "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
      "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
      "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
      "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
      "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
    }
  ]
}

Set selected repositories for an organization secret

put /orgs/{org}/actions/secrets/{secret_name}/repositories

Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

selected_repository_ids

array[int]

required

An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the visibility is set to selected. You can add and remove individual repositories using the Add selected repository to an organization secret and Remove selected repository from an organization secret endpoints.

Request

{
  "selected_repository_ids": [
    64780797
  ]
}

Response

ExamplesSchema

Response

Empty response

Add selected repository to an organization secret

put /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}

Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

secret_name

string

required

The name of the secret.

repository_id

int

required

Response

ExamplesSchema

No Content when repository was added to the selected list

Empty response

Remove selected repository from an organization secret

delete /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}

Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

secret_name

string

required

The name of the secret.

repository_id

int

required

Response

ExamplesSchema

Response when repository was removed from the selected list

Empty response

List organization variables

get /orgs/{org}/actions/variables

Lists all organization variables. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:read organization permission to use this endpoint.

per_page

int

The number of results per page (max 30).

Default
10

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 3,
  "variables": [
    {
      "name": "USERNAME",
      "value": "octocat",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "private"
    },
    {
      "name": "ACTIONS_RUNNER_DEBUG",
      "value": true,
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "all"
    },
    {
      "name": "ADMIN_EMAIL",
      "value": "octocat@github.com",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z",
      "visibility": "selected",
      "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/variables/ADMIN_EMAIL/repositories"
    }
  ]
}

Create an organization variable

post /orgs/{org}/actions/variables

Creates an organization variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

name

string

required

The name of the variable.

value

string

required

The value of the variable.

visibility

string

required

The type of repositories in the organization that can access the variable. selected means only the repositories specified by selected_repository_ids can access the variable.

Enum
  • all
  • private
  • selected

selected_repository_ids

array[int]

An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the visibility is set to selected.

Request

{
  "name": "USERNAME",
  "value": "octocat",
  "visibility": "selected",
  "selected_repository_ids": [
    1296269,
    1296280
  ]
}

Response

ExamplesSchema

Response when creating a variable

null

Get an organization variable

get /orgs/{org}/actions/variables/{name}

Gets a specific variable in an organization. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:read organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

name

string

required

The name of the variable.

Response

ExamplesSchema

Response

{
  "name": "USERNAME",
  "value": "octocat",
  "created_at": "2019-08-10T14:59:22Z",
  "updated_at": "2020-01-10T14:59:22Z",
  "visibility": "selected",
  "selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/variables/USERNAME/repositories"
}

Delete an organization variable

delete /orgs/{org}/actions/variables/{name}

Deletes an organization variable using the variable name. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

name

string

required

The name of the variable.

Response

ExamplesSchema

Response

Empty response

Update an organization variable

patch /orgs/{org}/actions/variables/{name}

Updates an organization variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

name

string

The name of the variable.

value

string

The value of the variable.

visibility

string

The type of repositories in the organization that can access the variable. selected means only the repositories specified by selected_repository_ids can access the variable.

Enum
  • all
  • private
  • selected

selected_repository_ids

array[int]

An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the visibility is set to selected.

Request

{
  "name": "USERNAME",
  "value": "octocat",
  "visibility": "selected",
  "selected_repository_ids": [
    1296269,
    1296280
  ]
}

Response

ExamplesSchema

Response

Empty response

List selected repositories for an organization variable

get /orgs/{org}/actions/variables/{name}/repositories

Lists all repositories that can access an organization variable that is available to selected repositories. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:read organization permission to use this endpoint.

page

int

Page number of the results to fetch.

Default
1

per_page

int

The number of results per page (max 100).

Default
30

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "repositories": [
    {
      "id": 1296269,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "name": "Hello-World",
      "full_name": "octocat/Hello-World",
      "owner": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "private": false,
      "html_url": "https://github.com/octocat/Hello-World",
      "description": "This your first repo!",
      "fork": false,
      "url": "https://api.github.com/repos/octocat/Hello-World",
      "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
      "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
      "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
      "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
      "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
      "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
      "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
      "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
      "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
      "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
      "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
      "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
      "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
      "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
      "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
      "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
      "git_url": "git:github.com/octocat/Hello-World.git",
      "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
      "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
      "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
      "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
      "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
      "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
      "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
      "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
      "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
      "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
      "ssh_url": "git@github.com:octocat/Hello-World.git",
      "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
      "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
      "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
      "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
      "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
      "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
      "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
      "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
    }
  ]
}

Set selected repositories for an organization variable

put /orgs/{org}/actions/variables/{name}/repositories

Replaces all repositories for an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their visibility field set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

selected_repository_ids

array[int]

required

The IDs of the repositories that can access the organization variable.

Request

{
  "selected_repository_ids": [
    64780797
  ]
}

Response

ExamplesSchema

Response

Empty response

Add selected repository to an organization variable

put /orgs/{org}/actions/variables/{name}/repositories/{repository_id}

Adds a repository to an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their visibility field set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

name

string

required

The name of the variable.

repository_id

int

required

Response

ExamplesSchema

Response

Empty response

Remove selected repository from an organization variable

delete /orgs/{org}/actions/variables/{name}/repositories/{repository_id}

Removes a repository from an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their visibility field set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the organization_actions_variables:write organization permission to use this endpoint.

org

string

required

The organization name. The name is not case sensitive.

name

string

required

The name of the variable.

repository_id

int

required

Response

ExamplesSchema

Response

Empty response

List repository required workflows

get /repos/{org}/{repo}/actions/required_workflows

Lists the required workflows in a repository. 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. For more information, see "Required Workflows."

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "required_workflows": [
    {
      "id": 161335,
      "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
      "name": "RequiredCI",
      "path": ".github/workflows/required_ci.yaml",
      "state": "active",
      "created_at": "2020-01-08T23:48:37.000-08:00",
      "updated_at": "2020-01-08T23:50:21.000-08:00",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/required_workflows/161335",
      "html_url": "https://github.com/octo-org/octo-repo/blob/master/octo-org/hello-world/.github/workflows/required_ci.yaml",
      "badge_url": "https://github.com/octo-org/octo-repo/workflows/required/octo-org/hello-world/.github/workflows/required_ci.yaml/badge.svg",
      "source_repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octo-org/Hello-World",
        "owner": {
          "login": "octo-org",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octo-org_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octo-org",
          "html_url": "https://github.com/octo-org",
          "followers_url": "https://api.github.com/users/octo-org/followers",
          "following_url": "https://api.github.com/users/octo-org/following{/other_user}",
          "gists_url": "https://api.github.com/users/octo-org/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octo-org/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octo-org/subscriptions",
          "organizations_url": "https://api.github.com/users/octo-org/orgs",
          "repos_url": "https://api.github.com/users/octo-org/repos",
          "events_url": "https://api.github.com/users/octo-org/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octo-org/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octo-org/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octo-org/Hello-World",
        "archive_url": "https://api.github.com/repos/octo-org/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octo-org/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octo-org/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octo-org/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octo-org/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octo-org/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octo-org/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octo-org/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octo-org/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octo-org/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octo-org/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octo-org/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octo-org/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octo-org/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octo-org/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octo-org/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octo-org/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octo-org/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octo-org/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octo-org/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octo-org/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octo-org/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octo-org/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octo-org/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octo-org/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octo-org/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octo-org/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octo-org/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octo-org/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octo-org/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octo-org/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octo-org/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octo-org/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octo-org/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octo-org/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octo-org/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octo-org/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octo-org/Hello-World/hooks"
      }
    }
  ]
}

Get a required workflow entity for a repository

get /repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}

Gets a specific required workflow present in a repository. 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. For more information, see "Required Workflows."

org

string

required

The organization name. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

required_workflow_id_for_repo

int

required

The ID of the required workflow that has run at least once in a repository.

Response

ExamplesSchema

Response

{
  "id": 161335,
  "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
  "name": "RequiredCI",
  "path": ".github/workflows/required_ci.yaml",
  "state": "active",
  "created_at": "2020-01-08T23:48:37.000-08:00",
  "updated_at": "2020-01-08T23:50:21.000-08:00",
  "url": "https://api.github.com/repos/octo-org/octo-repo/actions/required_workflows/161335",
  "html_url": "https://github.com/octo-org/octo-repo/blob/master/octo-org/hello-world/.github/workflows/required_ci.yaml",
  "badge_url": "https://github.com/octo-org/octo-repo/workflows/required/octo-org/hello-world/.github/workflows/required_ci.yaml/badge.svg",
  "source_repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octo-org/Hello-World",
    "owner": {
      "login": "octo-org",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octo-org_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octo-org",
      "html_url": "https://github.com/octo-org",
      "followers_url": "https://api.github.com/users/octo-org/followers",
      "following_url": "https://api.github.com/users/octo-org/following{/other_user}",
      "gists_url": "https://api.github.com/users/octo-org/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octo-org/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octo-org/subscriptions",
      "organizations_url": "https://api.github.com/users/octo-org/orgs",
      "repos_url": "https://api.github.com/users/octo-org/repos",
      "events_url": "https://api.github.com/users/octo-org/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octo-org/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octo-org/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octo-org/Hello-World",
    "archive_url": "https://api.github.com/repos/octo-org/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octo-org/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octo-org/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octo-org/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octo-org/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octo-org/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octo-org/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octo-org/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octo-org/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octo-org/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octo-org/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octo-org/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octo-org/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octo-org/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octo-org/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octo-org/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octo-org/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octo-org/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octo-org/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octo-org/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octo-org/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octo-org/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octo-org/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octo-org/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octo-org/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octo-org/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octo-org/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octo-org/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octo-org/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octo-org/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octo-org/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octo-org/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octo-org/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octo-org/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octo-org/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octo-org/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octo-org/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octo-org/Hello-World/hooks"
  }
}

List artifacts for a repository

get /repos/{owner}/{repo}/actions/artifacts

Lists all artifacts for a repository. 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.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

name

string

Filters artifacts by exact match on their name field.

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "artifacts": [
    {
      "id": 11,
      "node_id": "MDg6QXJ0aWZhY3QxMQ==",
      "name": "Rails",
      "size_in_bytes": 556,
      "url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
      "archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
      "expired": false,
      "created_at": "2020-01-10T14:59:22Z",
      "expires_at": "2020-03-21T14:59:22Z",
      "updated_at": "2020-02-21T14:59:22Z",
      "workflow_run": {
        "id": 2332938,
        "repository_id": 1296269,
        "head_repository_id": 1296269,
        "head_branch": "main",
        "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3"
      }
    },
    {
      "id": 13,
      "node_id": "MDg6QXJ0aWZhY3QxMw==",
      "name": "Test output",
      "size_in_bytes": 453,
      "url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13",
      "archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip",
      "expired": false,
      "created_at": "2020-01-10T14:59:22Z",
      "expires_at": "2020-03-21T14:59:22Z",
      "updated_at": "2020-02-21T14:59:22Z",
      "workflow_run": {
        "id": 2332942,
        "repository_id": 1296269,
        "head_repository_id": 1296269,
        "head_branch": "main",
        "head_sha": "178f4f6090b3fccad4a65b3e83d076a622d59652"
      }
    }
  ]
}

Get an artifact

get /repos/{owner}/{repo}/actions/artifacts/{artifact_id}

Gets a specific artifact for a workflow run. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

artifact_id

int

required

The unique identifier of the artifact.

Response

ExamplesSchema

Response

{
  "id": 11,
  "node_id": "MDg6QXJ0aWZhY3QxMQ==",
  "name": "Rails",
  "size_in_bytes": 556,
  "url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
  "archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
  "expired": false,
  "created_at": "2020-01-10T14:59:22Z",
  "expires_at": "2020-01-21T14:59:22Z",
  "updated_at": "2020-01-21T14:59:22Z",
  "workflow_run": {
    "id": 2332938,
    "repository_id": 1296269,
    "head_repository_id": 1296269,
    "head_branch": "main",
    "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3"
  }
}

Delete an artifact

delete /repos/{owner}/{repo}/actions/artifacts/{artifact_id}

Deletes an artifact for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

artifact_id

int

required

The unique identifier of the artifact.

Response

ExamplesSchema

Response

Empty response

Download an artifact

get /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}

Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for Location: in the response header to find the URL for the download. The :archive_format must be zip. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

artifact_id

int

required

The unique identifier of the artifact.

archive_format

string

required

Response

ExamplesSchema

Response

Empty response

Get GitHub Actions cache usage for a repository

get /repos/{owner}/{repo}/actions/cache/usage

Gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "full_name": "octo-org/Hello-World",
  "active_caches_size_in_bytes": 2322142,
  "active_caches_count": 3
}

Get GitHub Actions cache usage policy for a repository

get /repos/{owner}/{repo}/actions/cache/usage-policy

Gets GitHub Actions cache usage policy for a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:read permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "repo_cache_size_limit_in_gb": 14
}

Set GitHub Actions cache usage policy for a repository

patch /repos/{owner}/{repo}/actions/cache/usage-policy

Sets GitHub Actions cache usage policy for a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

repo_cache_size_limit_in_gb

int

required

The size limit for the sum of all caches, in gigabytes.

Example
14

Request

{
  "repo_cache_size_limit_in_gb": 14
}

Response

ExamplesSchema

Response

Empty response

List GitHub Actions caches for a repository

get /repos/{owner}/{repo}/actions/caches

Lists the GitHub Actions caches for a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:read permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

ref

string

The full Git reference for narrowing down the cache. The ref for a branch should be formatted as refs/heads/<branch name>. To reference a pull request use refs/pull/<number>/merge.

key

string

An explicit key or prefix for identifying the cache

sort

string

The property to sort the results by. created_at means when the cache was created. last_accessed_at means when the cache was last accessed. size_in_bytes is the size of the cache in bytes.

Default
"last_accessed_at"
Enum
  • created_at
  • last_accessed_at
  • size_in_bytes

direction

string

The direction to sort the results by.

Default
"desc"
Enum
  • asc
  • desc

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "actions_caches": [
    {
      "id": 505,
      "ref": "refs/heads/main",
      "key": "Linux-node-958aff96db2d75d67787d1e634ae70b659de937b",
      "version": "73885106f58cc52a7df9ec4d4a5622a5614813162cb516c759a30af6bf56e6f0",
      "last_accessed_at": "2019-01-24T22:45:36.000Z",
      "created_at": "2019-01-24T22:45:36.000Z",
      "size_in_bytes": 1024
    }
  ]
}

Delete GitHub Actions caches for a repository (using a cache key)

delete /repos/{owner}/{repo}/actions/caches

Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.

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

GitHub Apps must have the actions:write permission to use this endpoint.

key

string

required

A key for identifying the cache.

ref

string

The full Git reference for narrowing down the cache. The ref for a branch should be formatted as refs/heads/<branch name>. To reference a pull request use refs/pull/<number>/merge.

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "actions_caches": [
    {
      "id": 505,
      "ref": "refs/heads/main",
      "key": "Linux-node-958aff96db2d75d67787d1e634ae70b659de937b",
      "version": "73885106f58cc52a7df9ec4d4a5622a5614813162cb516c759a30af6bf56e6f0",
      "last_accessed_at": "2019-01-24T22:45:36.000Z",
      "created_at": "2019-01-24T22:45:36.000Z",
      "size_in_bytes": 1024
    }
  ]
}

Delete a GitHub Actions cache for a repository (using a cache ID)

delete /repos/{owner}/{repo}/actions/caches/{cache_id}

Deletes a GitHub Actions cache for a repository, using a cache ID.

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

GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

cache_id

int

required

The unique identifier of the GitHub Actions cache.

Response

ExamplesSchema

Response

Empty response

Get a job for a workflow run

get /repos/{owner}/{repo}/actions/jobs/{job_id}

Gets a specific job in a workflow run. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

job_id

int

required

The unique identifier of the job.

Response

ExamplesSchema

Response

{
  "id": 399444496,
  "run_id": 29679449,
  "run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
  "node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
  "head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
  "url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
  "html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
  "status": "completed",
  "conclusion": "success",
  "started_at": "2020-01-20T17:42:40Z",
  "completed_at": "2020-01-20T17:44:39Z",
  "name": "build",
  "steps": [
    {
      "name": "Set up job",
      "status": "completed",
      "conclusion": "success",
      "number": 1,
      "started_at": "2020-01-20T09:42:40.000-08:00",
      "completed_at": "2020-01-20T09:42:41.000-08:00"
    },
    {
      "name": "Run actions/checkout@v2",
      "status": "completed",
      "conclusion": "success",
      "number": 2,
      "started_at": "2020-01-20T09:42:41.000-08:00",
      "completed_at": "2020-01-20T09:42:45.000-08:00"
    },
    {
      "name": "Set up Ruby",
      "status": "completed",
      "conclusion": "success",
      "number": 3,
      "started_at": "2020-01-20T09:42:45.000-08:00",
      "completed_at": "2020-01-20T09:42:45.000-08:00"
    },
    {
      "name": "Run actions/cache@v3",
      "status": "completed",
      "conclusion": "success",
      "number": 4,
      "started_at": "2020-01-20T09:42:45.000-08:00",
      "completed_at": "2020-01-20T09:42:48.000-08:00"
    },
    {
      "name": "Install Bundler",
      "status": "completed",
      "conclusion": "success",
      "number": 5,
      "started_at": "2020-01-20T09:42:48.000-08:00",
      "completed_at": "2020-01-20T09:42:52.000-08:00"
    },
    {
      "name": "Install Gems",
      "status": "completed",
      "conclusion": "success",
      "number": 6,
      "started_at": "2020-01-20T09:42:52.000-08:00",
      "completed_at": "2020-01-20T09:42:53.000-08:00"
    },
    {
      "name": "Run Tests",
      "status": "completed",
      "conclusion": "success",
      "number": 7,
      "started_at": "2020-01-20T09:42:53.000-08:00",
      "completed_at": "2020-01-20T09:42:59.000-08:00"
    },
    {
      "name": "Deploy to Heroku",
      "status": "completed",
      "conclusion": "success",
      "number": 8,
      "started_at": "2020-01-20T09:42:59.000-08:00",
      "completed_at": "2020-01-20T09:44:39.000-08:00"
    },
    {
      "name": "Post actions/cache@v3",
      "status": "completed",
      "conclusion": "success",
      "number": 16,
      "started_at": "2020-01-20T09:44:39.000-08:00",
      "completed_at": "2020-01-20T09:44:39.000-08:00"
    },
    {
      "name": "Complete job",
      "status": "completed",
      "conclusion": "success",
      "number": 17,
      "started_at": "2020-01-20T09:44:39.000-08:00",
      "completed_at": "2020-01-20T09:44:39.000-08:00"
    }
  ],
  "check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
  "labels": [
    "self-hosted",
    "foo",
    "bar"
  ],
  "runner_id": 1,
  "runner_name": "my runner",
  "runner_group_id": 2,
  "runner_group_name": "my runner group",
  "workflow_name": "CI",
  "head_branch": "main"
}

Download job logs for a workflow run

get /repos/{owner}/{repo}/actions/jobs/{job_id}/logs

Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for Location: in the response header to find the URL for the download. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

job_id

int

required

The unique identifier of the job.

Response

ExamplesSchema

Response

Empty response

Re-run a job from a workflow run

post /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun

Re-run a job and its dependent jobs in a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

enable_debug_logging

boolean

Whether to enable debug logging for the re-run.

Default
false

Request

null

Response

ExamplesSchema

Response

null

Get the customization template for an OIDC subject claim for a repository

get /repos/{owner}/{repo}/actions/oidc/customization/sub

Gets the customization template for an OpenID Connect (OIDC) subject claim. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the organization_administration:read permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Status response

{
  "use_default": false,
  "include_claim_keys": [
    "repo",
    "context"
  ]
}

Set the customization template for an OIDC subject claim for a repository

put /repos/{owner}/{repo}/actions/oidc/customization/sub

Sets the customization template and opt-in or opt-out flag for an OpenID Connect (OIDC) subject claim for a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

use_default

boolean

required

Whether to use the default template or not. If true, the include_claim_keys field is ignored.

include_claim_keys

array[string]

Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.

Request

{
  "use_default": false,
  "include_claim_keys": [
    "repo",
    "context"
  ]
}

Response

ExamplesSchema

Empty response

null

List repository organization secrets

get /repos/{owner}/{repo}/actions/organization-secrets

Lists all organization secrets shared with a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "secrets": [
    {
      "name": "GH_TOKEN",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "GIST_ID",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

List repository organization variables

get /repos/{owner}/{repo}/actions/organization-variables

Lists all organiation variables shared with a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:read repository permission to use this endpoint.

per_page

int

The number of results per page (max 30).

Default
10

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "variables": [
    {
      "name": "USERNAME",
      "value": "octocat",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "EMAIL",
      "value": "octocat@github.com",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

Get GitHub Actions permissions for a repository

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

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "enabled": true,
  "allowed_actions": "selected",
  "selected_actions_url": "https://api.github.com/repositories/42/actions/permissions/selected-actions"
}

Set GitHub Actions permissions for a repository

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

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.

enabled

boolean

required

Whether GitHub Actions is enabled on the repository.

allowed_actions

string

The permissions policy that controls the actions that are allowed to run.

Enum
  • all
  • local_only
  • selected

Request

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

Response

ExamplesSchema

Response

Empty response

Get the level of access for workflows outside of the repository

get /repos/{owner}/{repo}/actions/permissions/access

Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal and private repositories. For more information, see "Allowing access to components in a private repository" and "Allowing access to components in an internal repository."

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "access_level": "organization"
}

Set the level of access for workflows outside of the repository

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

Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal and private repositories. For more information, see "Allowing access to components in a private repository" and "Allowing access to components in an internal repository."

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

access_level

string

required

Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the repository.

none means the access is only possible from workflows in this repository. user level access allows sharing across user owned private repos only. organization level access allows sharing across the organization. enterprise level access allows sharing across the enterprise.

Enum
  • none
  • user
  • organization
  • enterprise

Request

{
  "access_level": "organization"
}

Response

ExamplesSchema

Response

Empty response

Get allowed actions for a repository

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

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

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

Set allowed actions for a repository

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

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.

github_owned_allowed

boolean

required

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

patterns_allowed

array[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/*.

Request

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

Response

ExamplesSchema

Response

Empty response

Get default workflow permissions for a repository

get /repos/{owner}/{repo}/actions/permissions/workflow

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository, as well as if GitHub Actions can submit approving pull request reviews. For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Set default workflow permissions for a repository

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

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository, and sets if GitHub Actions can submit approving pull request reviews. For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

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

default_workflow_permissions

string

The default workflow permissions granted to the GITHUB_TOKEN when running workflows.

Enum
  • read
  • write

can_approve_pull_request_reviews

boolean

Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.

Request

{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}

Response

ExamplesSchema

Success response

Empty response

List workflow runs for a required workflow

get /repos/{owner}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/runs

List all workflow runs for a required workflow. 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. For more information, see "Required Workflows."

actor

string

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

branch

string

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

event

string

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

status

string

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.

Enum
  • completed
  • action_required
  • cancelled
  • failure
  • neutral
  • skipped
  • stale
  • success
  • timed_out
  • in_progress
  • queued
  • requested
  • waiting
  • pending

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

created

string

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_requests

boolean

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

Default
false

check_suite_id

int

Returns workflow runs with the check_suite_id that you specify.

head_sha

string

Only returns workflow runs that are associated with the specified head_sha.

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "workflow_runs": [
    {
      "id": 30433642,
      "name": "Build",
      "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
      "check_suite_id": 42,
      "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
      "head_branch": "master",
      "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
      "run_number": 562,
      "event": "push",
      "status": "queued",
      "conclusion": null,
      "workflow_id": 159038,
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
      "html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
      "pull_requests": [],
      "created_at": "2020-01-22T19:33:08Z",
      "updated_at": "2020-01-22T19:33:08Z",
      "actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "run_attempt": 1,
      "run_started_at": "2020-01-22T19:33:08Z",
      "triggering_actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
      "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
      "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
      "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
      "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
      "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
      "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
      "head_commit": {
        "id": "acb5820ced9479c074f688cc328bf03f341a511d",
        "tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
        "message": "Create linter.yaml",
        "timestamp": "2020-01-22T19:33:05Z",
        "author": {
          "name": "Octo Cat",
          "email": "octocat@github.com"
        },
        "committer": {
          "name": "GitHub",
          "email": "noreply@github.com"
        }
      },
      "repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
      },
      "head_repository": {
        "id": 217723378,
        "node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
        "name": "octo-repo",
        "full_name": "octo-org/octo-repo",
        "private": true,
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "html_url": "https://github.com/octo-org/octo-repo",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/octo-org/octo-repo",
        "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
        "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
        "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
        "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
        "events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
        "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
        "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
        "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
        "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
        "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
        "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
        "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
        "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
        "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
        "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
        "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
        "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
        "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
        "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
        "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
      }
    }
  ]
}

List self-hosted runners for a repository

get /repos/{owner}/{repo}/actions/runners

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

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "runners": [
    {
      "id": 23,
      "name": "linux_runner",
      "os": "linux",
      "status": "online",
      "busy": true,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 11,
          "name": "Linux",
          "type": "read-only"
        }
      ]
    },
    {
      "id": 24,
      "name": "mac_runner",
      "os": "macos",
      "status": "offline",
      "busy": false,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
          "name": "X64",
          "type": "read-only"
        },
        {
          "id": 20,
          "name": "macOS",
          "type": "read-only"
        },
        {
          "id": 21,
          "name": "no-gpu",
          "type": "custom"
        }
      ]
    }
  ]
}

List runner applications for a repository

get /repos/{owner}/{repo}/actions/runners/downloads

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

[
  {
    "os": "osx",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-osx-x64-2.277.1.tar.gz",
    "filename": "actions-runner-osx-x64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "f1fa173889dc9036cd529417e652e1729e5a3f4d35ec0151806d7480fda6b89b"
  },
  {
    "os": "linux",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-x64-2.277.1.tar.gz",
    "filename": "actions-runner-linux-x64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "02d710fc9e0008e641274bb7da7fde61f7c9aa1cbb541a2990d3450cc88f4e98"
  },
  {
    "os": "linux",
    "architecture": "arm",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-arm-2.277.1.tar.gz",
    "filename": "actions-runner-linux-arm-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIyYTEzZDRmZC01ZDhkLTRjNzgtYjg2MS0zYTMxZGQ3MmYzNjQiLCJzaWQiOiI0MzZiNTg3YS04ODMyLTRiMTMtOWM2Ny05OWRkMjA2ZTQzNmMiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MzE1NzEsImV4cCI6MTYxNzkzNTc3MX0.PMhU7-MOnZRDj5k5a4ieeFlQCmKPl2pQvpVRhGZq-9ByKF5s9G0rsnGBxDcolTYlbvEAmSSkeAEwF486F7P0kMVEb-GI14WbErqqMSyaPL81c3W7UHxMJLaSBnDs9ftHMv_IkJmRzaROS8q1ObzUW-ErlltxCdj2zF_5ruK9G2RR566AOAtiA3AHV6k7-FCY5--sDYJN_YXPgpwI0fPN1TM92fdPm93hJnoXuCJNpBYp1vl5W4gwGtU_Pa07ESdqqFN1YJJHUloedNhiIOczGfGVSapRc8vyGm9P_VCM_yKD8JI-MkOXl8JI5fCfhmjmKsw-vSAh9NW67RGvmehmpw",
    "sha256_checksum": "2f2bda21e2fd8fed6938b33182a293f6b1f74e4c5d09acd6d9a0fe3f979f5c85"
  },
  {
    "os": "win",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-win-x64-2.277.1.zip",
    "filename": "actions-runner-win-x64-2.277.1.zip",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "7215c75a462eeb6a839fa8ed298d79f620617d44d47d37c583114fc3f3b27b30"
  },
  {
    "os": "linux",
    "architecture": "arm64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-arm64-2.277.1.tar.gz",
    "filename": "actions-runner-linux-arm64-2.277.1.tar.gz",
    "temp_download_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJmSjdCUXpLdXhjWDc4WnJ5NUxnUW53ZFRrMCJ9.eyJuYW1laWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJzY3AiOiJBY3Rpb25zUnVudGltZS5QYWNrYWdlRG93bmxvYWQiLCJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJERERERERERC1ERERELUREREQtRERERC1EREREREREREREREQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiJkZGRkZGRkZC1kZGRkLWRkZGQtZGRkZC1kZGRkZGRkZGRkZGQiLCJhdWkiOiIwZTZkODAxYi02NzVlLTQ1YzAtOWM4NC1jYTkzNjdlZjc1NjciLCJzaWQiOiI4ZTE5MDliZC1kYzU1LTQ2MWYtOTk2Mi1hZTI0OTEzNzU4OWIiLCJpc3MiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJhdWQiOiJ2c3Rva2VuLmNvZGVkZXYubXMiLCJuYmYiOjE2MTc5MDQxNzUsImV4cCI6MTYxNzkwODM3NX0.YNsRXL9pBuIfLVndnyVQOpru77Br8hgYIX7LPsOaMfKk4K88YG89a2VIXUWPyHRiOaC-4J0lIPei8ujezEtnMfNZCwHdWq0Niiy-2-ywcfGPmcz-RHz_ZglkPFbzKaiZWJcFKCGHCP0Ta3kdXumJQqiVJEIyppxIY-caR_Wsw2L4BZHOefJq-odsJ0guPgm9fVuU9FxVRkucho1UH_bzt0tAMl1gEWOLBLZ88U9LKCzHWaxheFeBV4DTt1lAcSm213gKP1eMbgAGn5heWhR4RMRBzZc2HO3Lf1syu4E8fW8a-esRAxEYPfqPHwN9LNj2jaU3D3nPwa8lHQLLtA1PNA",
    "sha256_checksum": "a6aa6dd0ba217118ef2b4ea24e9e0a85b02b13c38052a5de0776d6ced3a79c64"
  }
]

Create a registration token for a repository

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

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
  "expires_at": "2020-01-22T12:13:35.123-08:00"
}

Create a remove token for a repository

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

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
  "expires_at": "2020-01-29T12:13:35.123-08:00"
}

Get a self-hosted runner for a repository

get /repos/{owner}/{repo}/actions/runners/{runner_id}

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "id": 23,
  "name": "MBP",
  "os": "macos",
  "status": "online",
  "busy": true,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Delete a self-hosted runner from a repository

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

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

Empty response

List labels for a self-hosted runner for a repository

get /repos/{owner}/{repo}/actions/runners/{runner_id}/labels

Lists all labels for a self-hosted runner configured in a repository.

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Add custom labels to a self-hosted runner for a repository

post /repos/{owner}/{repo}/actions/runners/{runner_id}/labels

Add custom labels to a self-hosted runner configured in a repository.

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

labels

array[string]

required

The names of the custom labels to add to the runner.

Request

{
  "labels": [
    "gpu",
    "accelerated"
  ]
}

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Set custom labels for a self-hosted runner for a repository

put /repos/{owner}/{repo}/actions/runners/{runner_id}/labels

Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository.

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

labels

array[string]

required

The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.

Request

{
  "labels": [
    "gpu",
    "accelerated"
  ]
}

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

Remove all custom labels from a self-hosted runner for a repository

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

Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner.

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

Response

ExamplesSchema

Response

{
  "total_count": 3,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    }
  ]
}

Remove a custom label from a self-hosted runner for a repository

delete /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}

Remove a custom label from a self-hosted runner configured in a repository. Returns the remaining labels from the runner.

This endpoint returns a 404 Not Found status if the custom label is not present on the runner.

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

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

runner_id

int

required

Unique identifier of the self-hosted runner.

name

string

required

The name of a self-hosted runner's custom label.

Response

ExamplesSchema

Response

{
  "total_count": 4,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    },
    {
      "id": 21,
      "name": "no-gpu",
      "type": "custom"
    }
  ]
}

List workflow runs for a repository

get /repos/{owner}/{repo}/actions/runs

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.

actor

string

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

branch

string

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

event

string

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

status

string

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.

Enum
  • completed
  • action_required
  • cancelled
  • failure
  • neutral
  • skipped
  • stale
  • success
  • timed_out
  • in_progress
  • queued
  • requested
  • waiting
  • pending

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

created

string

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_requests

boolean

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

Default
false

check_suite_id

int

Returns workflow runs with the check_suite_id that you specify.

head_sha

string

Only returns workflow runs that are associated with the specified head_sha.

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "workflow_runs": [
    {
      "id": 30433642,
      "name": "Build",
      "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
      "check_suite_id": 42,
      "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
      "head_branch": "master",
      "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
      "run_number": 562,
      "event": "push",
      "status": "queued",
      "conclusion": null,
      "workflow_id": 159038,
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
      "html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
      "pull_requests": [],
      "created_at": "2020-01-22T19:33:08Z",
      "updated_at": "2020-01-22T19:33:08Z",
      "actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "run_attempt": 1,
      "run_started_at": "2020-01-22T19:33:08Z",
      "triggering_actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
      "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
      "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
      "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
      "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
      "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
      "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
      "head_commit": {
        "id": "acb5820ced9479c074f688cc328bf03f341a511d",
        "tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
        "message": "Create linter.yaml",
        "timestamp": "2020-01-22T19:33:05Z",
        "author": {
          "name": "Octo Cat",
          "email": "octocat@github.com"
        },
        "committer": {
          "name": "GitHub",
          "email": "noreply@github.com"
        }
      },
      "repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
      },
      "head_repository": {
        "id": 217723378,
        "node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
        "name": "octo-repo",
        "full_name": "octo-org/octo-repo",
        "private": true,
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "html_url": "https://github.com/octo-org/octo-repo",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/octo-org/octo-repo",
        "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
        "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
        "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
        "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
        "events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
        "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
        "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
        "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
        "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
        "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
        "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
        "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
        "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
        "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
        "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
        "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
        "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
        "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
        "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
        "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
      }
    }
  ]
}

Get a workflow run

get /repos/{owner}/{repo}/actions/runs/{run_id}

Gets a specific workflow run. 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.

exclude_pull_requests

boolean

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

Default
false

Response

ExamplesSchema

Response

{
  "id": 30433642,
  "name": "Build",
  "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
  "check_suite_id": 42,
  "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
  "head_branch": "main",
  "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
  "path": ".github/workflows/build.yml@main",
  "run_number": 562,
  "event": "push",
  "display_title": "Update README.md",
  "status": "queued",
  "conclusion": null,
  "workflow_id": 159038,
  "url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
  "html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
  "pull_requests": [],
  "created_at": "2020-01-22T19:33:08Z",
  "updated_at": "2020-01-22T19:33:08Z",
  "actor": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "run_attempt": 1,
  "referenced_workflows": [
    {
      "path": "octocat/Hello-World/.github/workflows/deploy.yml@main",
      "sha": "86e8bc9ecf7d38b1ed2d2cfb8eb87ba9b35b01db",
      "ref": "refs/heads/main"
    },
    {
      "path": "octo-org/octo-repo/.github/workflows/report.yml@v2",
      "sha": "79e9790903e1c3373b1a3e3a941d57405478a232",
      "ref": "refs/tags/v2"
    },
    {
      "path": "octo-org/octo-repo/.github/workflows/secure.yml@1595d4b6de6a9e9751fb270a41019ce507d4099e",
      "sha": "1595d4b6de6a9e9751fb270a41019ce507d4099e"
    }
  ],
  "run_started_at": "2020-01-22T19:33:08Z",
  "triggering_actor": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
  "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
  "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
  "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
  "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
  "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
  "previous_attempt_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/attempts/1",
  "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
  "head_commit": {
    "id": "acb5820ced9479c074f688cc328bf03f341a511d",
    "tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
    "message": "Create linter.yaml",
    "timestamp": "2020-01-22T19:33:05Z",
    "author": {
      "name": "Octo Cat",
      "email": "octocat@github.com"
    },
    "committer": {
      "name": "GitHub",
      "email": "noreply@github.com"
    }
  },
  "repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octocat/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octocat/Hello-World",
    "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octocat/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octocat/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
  },
  "head_repository": {
    "id": 217723378,
    "node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
    "name": "octo-repo",
    "full_name": "octo-org/octo-repo",
    "private": true,
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/octo-org/octo-repo",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/octo-org/octo-repo",
    "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
    "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
    "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
    "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
    "events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
    "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
    "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
    "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
    "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
    "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
    "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
    "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
    "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
    "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
    "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
    "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
    "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
    "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
    "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
    "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
  }
}

Delete a workflow run

delete /repos/{owner}/{repo}/actions/runs/{run_id}

Delete a specific workflow run. Anyone with write 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:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

Empty response

Get the review history for a workflow run

get /repos/{owner}/{repo}/actions/runs/{run_id}/approvals

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

[
  {
    "state": "approved",
    "comment": "Ship it!",
    "environments": [
      {
        "id": 161088068,
        "node_id": "MDExOkVudmlyb25tZW50MTYxMDg4MDY4",
        "name": "staging",
        "url": "https://api.github.com/repos/github/hello-world/environments/staging",
        "html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging",
        "created_at": "2020-11-23T22:00:40Z",
        "updated_at": "2020-11-23T22:00:40Z"
      }
    ],
    "user": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    }
  }
]

List workflow run artifacts

get /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts

Lists artifacts for a workflow run. 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.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "artifacts": [
    {
      "id": 11,
      "node_id": "MDg6QXJ0aWZhY3QxMQ==",
      "name": "Rails",
      "size_in_bytes": 556,
      "url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
      "archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
      "expired": false,
      "created_at": "2020-01-10T14:59:22Z",
      "expires_at": "2020-03-21T14:59:22Z",
      "updated_at": "2020-02-21T14:59:22Z",
      "workflow_run": {
        "id": 2332938,
        "repository_id": 1296269,
        "head_repository_id": 1296269,
        "head_branch": "main",
        "head_sha": "328faa0536e6fef19753d9d91dc96a9931694ce3"
      }
    },
    {
      "id": 13,
      "node_id": "MDg6QXJ0aWZhY3QxMw==",
      "name": "Test output",
      "size_in_bytes": 453,
      "url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13",
      "archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip",
      "expired": false,
      "created_at": "2020-01-10T14:59:22Z",
      "expires_at": "2020-03-21T14:59:22Z",
      "updated_at": "2020-02-21T14:59:22Z",
      "workflow_run": {
        "id": 2332942,
        "repository_id": 1296269,
        "head_repository_id": 1296269,
        "head_branch": "main",
        "head_sha": "178f4f6090b3fccad4a65b3e83d076a622d59652"
      }
    }
  ]
}

Get a workflow run attempt

get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}

Gets a specific workflow run attempt. 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.

exclude_pull_requests

boolean

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

Default
false

Response

ExamplesSchema

Response

{
  "id": 30433642,
  "name": "Build",
  "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
  "check_suite_id": 42,
  "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
  "head_branch": "main",
  "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
  "path": ".github/workflows/build.yml@main",
  "run_number": 562,
  "event": "push",
  "display_title": "Update README.md",
  "status": "queued",
  "conclusion": null,
  "workflow_id": 159038,
  "url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
  "html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
  "pull_requests": [],
  "created_at": "2020-01-22T19:33:08Z",
  "updated_at": "2020-01-22T19:33:08Z",
  "actor": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "run_attempt": 1,
  "referenced_workflows": [
    {
      "path": "octocat/Hello-World/.github/workflows/deploy.yml@main",
      "sha": "86e8bc9ecf7d38b1ed2d2cfb8eb87ba9b35b01db",
      "ref": "refs/heads/main"
    },
    {
      "path": "octo-org/octo-repo/.github/workflows/report.yml@v2",
      "sha": "79e9790903e1c3373b1a3e3a941d57405478a232",
      "ref": "refs/tags/v2"
    },
    {
      "path": "octo-org/octo-repo/.github/workflows/secure.yml@1595d4b6de6a9e9751fb270a41019ce507d4099e",
      "sha": "1595d4b6de6a9e9751fb270a41019ce507d4099e"
    }
  ],
  "run_started_at": "2020-01-22T19:33:08Z",
  "triggering_actor": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
  "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
  "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
  "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
  "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
  "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
  "previous_attempt_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/attempts/1",
  "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
  "head_commit": {
    "id": "acb5820ced9479c074f688cc328bf03f341a511d",
    "tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
    "message": "Create linter.yaml",
    "timestamp": "2020-01-22T19:33:05Z",
    "author": {
      "name": "Octo Cat",
      "email": "octocat@github.com"
    },
    "committer": {
      "name": "GitHub",
      "email": "noreply@github.com"
    }
  },
  "repository": {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "name": "Hello-World",
    "full_name": "octocat/Hello-World",
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/octocat/Hello-World",
    "description": "This your first repo!",
    "fork": false,
    "url": "https://api.github.com/repos/octocat/Hello-World",
    "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
    "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
    "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
    "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
    "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
    "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
    "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
    "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
    "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
    "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
    "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
    "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
    "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
    "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
    "git_url": "git:github.com/octocat/Hello-World.git",
    "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
    "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
    "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
    "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
    "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
    "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
    "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
    "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
    "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
    "ssh_url": "git@github.com:octocat/Hello-World.git",
    "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
    "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
    "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
    "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
    "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
    "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
    "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
    "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
  },
  "head_repository": {
    "id": 217723378,
    "node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
    "name": "octo-repo",
    "full_name": "octo-org/octo-repo",
    "private": true,
    "owner": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/octo-org/octo-repo",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/octo-org/octo-repo",
    "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
    "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
    "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
    "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
    "events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
    "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
    "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
    "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
    "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
    "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
    "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
    "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
    "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
    "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
    "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
    "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
    "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
    "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
    "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
    "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
  }
}

List jobs for a workflow run attempt

get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs

Lists jobs for a specific workflow run attempt. 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. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "jobs": [
    {
      "id": 399444496,
      "run_id": 29679449,
      "run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
      "node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
      "head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
      "html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
      "status": "completed",
      "conclusion": "success",
      "started_at": "2020-01-20T17:42:40Z",
      "completed_at": "2020-01-20T17:44:39Z",
      "name": "build",
      "steps": [
        {
          "name": "Set up job",
          "status": "completed",
          "conclusion": "success",
          "number": 1,
          "started_at": "2020-01-20T09:42:40.000-08:00",
          "completed_at": "2020-01-20T09:42:41.000-08:00"
        },
        {
          "name": "Run actions/checkout@v2",
          "status": "completed",
          "conclusion": "success",
          "number": 2,
          "started_at": "2020-01-20T09:42:41.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Set up Ruby",
          "status": "completed",
          "conclusion": "success",
          "number": 3,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Run actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 4,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:48.000-08:00"
        },
        {
          "name": "Install Bundler",
          "status": "completed",
          "conclusion": "success",
          "number": 5,
          "started_at": "2020-01-20T09:42:48.000-08:00",
          "completed_at": "2020-01-20T09:42:52.000-08:00"
        },
        {
          "name": "Install Gems",
          "status": "completed",
          "conclusion": "success",
          "number": 6,
          "started_at": "2020-01-20T09:42:52.000-08:00",
          "completed_at": "2020-01-20T09:42:53.000-08:00"
        },
        {
          "name": "Run Tests",
          "status": "completed",
          "conclusion": "success",
          "number": 7,
          "started_at": "2020-01-20T09:42:53.000-08:00",
          "completed_at": "2020-01-20T09:42:59.000-08:00"
        },
        {
          "name": "Deploy to Heroku",
          "status": "completed",
          "conclusion": "success",
          "number": 8,
          "started_at": "2020-01-20T09:42:59.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Post actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 16,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Complete job",
          "status": "completed",
          "conclusion": "success",
          "number": 17,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        }
      ],
      "check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
      "labels": [
        "self-hosted",
        "foo",
        "bar"
      ],
      "runner_id": 1,
      "runner_name": "my runner",
      "runner_group_id": 2,
      "runner_group_name": "my runner group",
      "workflow_name": "CI",
      "head_branch": "main"
    }
  ]
}

Download workflow run attempt logs

get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs

Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after 1 minute. Look for Location: in the response header to find the URL for the download. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

attempt_number

int

required

The attempt number of the workflow run.

Response

ExamplesSchema

Response

Empty response

Cancel a workflow run

post /repos/{owner}/{repo}/actions/runs/{run_id}/cancel

Cancels a workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

null

List jobs for a workflow run

get /repos/{owner}/{repo}/actions/runs/{run_id}/jobs

Lists jobs for a workflow run. 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. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

filter

string

Filters jobs by their completed_at timestamp. latest returns jobs from the most recent execution of the workflow run. all returns all jobs for a workflow run, including from old executions of the workflow run.

Default
"latest"
Enum
  • latest
  • all

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "jobs": [
    {
      "id": 399444496,
      "run_id": 29679449,
      "run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
      "node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
      "head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
      "html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
      "status": "completed",
      "conclusion": "success",
      "started_at": "2020-01-20T17:42:40Z",
      "completed_at": "2020-01-20T17:44:39Z",
      "name": "build",
      "steps": [
        {
          "name": "Set up job",
          "status": "completed",
          "conclusion": "success",
          "number": 1,
          "started_at": "2020-01-20T09:42:40.000-08:00",
          "completed_at": "2020-01-20T09:42:41.000-08:00"
        },
        {
          "name": "Run actions/checkout@v2",
          "status": "completed",
          "conclusion": "success",
          "number": 2,
          "started_at": "2020-01-20T09:42:41.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Set up Ruby",
          "status": "completed",
          "conclusion": "success",
          "number": 3,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Run actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 4,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:48.000-08:00"
        },
        {
          "name": "Install Bundler",
          "status": "completed",
          "conclusion": "success",
          "number": 5,
          "started_at": "2020-01-20T09:42:48.000-08:00",
          "completed_at": "2020-01-20T09:42:52.000-08:00"
        },
        {
          "name": "Install Gems",
          "status": "completed",
          "conclusion": "success",
          "number": 6,
          "started_at": "2020-01-20T09:42:52.000-08:00",
          "completed_at": "2020-01-20T09:42:53.000-08:00"
        },
        {
          "name": "Run Tests",
          "status": "completed",
          "conclusion": "success",
          "number": 7,
          "started_at": "2020-01-20T09:42:53.000-08:00",
          "completed_at": "2020-01-20T09:42:59.000-08:00"
        },
        {
          "name": "Deploy to Heroku",
          "status": "completed",
          "conclusion": "success",
          "number": 8,
          "started_at": "2020-01-20T09:42:59.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Post actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 16,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Complete job",
          "status": "completed",
          "conclusion": "success",
          "number": 17,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        }
      ],
      "check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
      "labels": [
        "self-hosted",
        "foo",
        "bar"
      ],
      "runner_id": 1,
      "runner_name": "my runner",
      "runner_group_id": 2,
      "runner_group_name": "my runner group",
      "workflow_name": "CI",
      "head_branch": "main"
    }
  ]
}

Download workflow run logs

get /repos/{owner}/{repo}/actions/runs/{run_id}/logs

Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for Location: in the response header to find the URL for the download. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

Empty response

Delete workflow run logs

delete /repos/{owner}/{repo}/actions/runs/{run_id}/logs

Deletes all logs for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

Empty response

Get pending deployments for a workflow run

get /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments

Get all deployment environments for a workflow run that are waiting for protection rules to pass.

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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

run_id

int

required

The unique identifier of the workflow run.

Response

ExamplesSchema

Response

[
  {
    "environment": {
      "id": 161088068,
      "node_id": "MDExOkVudmlyb25tZW50MTYxMDg4MDY4",
      "name": "staging",
      "url": "https://api.github.com/repos/github/hello-world/environments/staging",
      "html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging"
    },
    "wait_timer": 30,
    "wait_timer_started_at": "2020-11-23T22:00:40Z",
    "current_user_can_approve": true,
    "reviewers": [
      {
        "type": "User",
        "reviewer": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        }
      },
      {
        "type": "Team",
        "reviewer": {
          "id": 1,
          "node_id": "MDQ6VGVhbTE=",
          "url": "https://api.github.com/teams/1",
          "html_url": "https://github.com/orgs/github/teams/justice-league",
          "name": "Justice League",
          "slug": "justice-league",
          "description": "A great team.",
          "privacy": "closed",
          "permission": "admin",
          "members_url": "https://api.github.com/teams/1/members{/member}",
          "repositories_url": "https://api.github.com/teams/1/repos",
          "parent": null
        }
      }
    ]
  }
]

Review pending deployments for a workflow run

post /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments

Approve or reject pending deployments that are waiting on approval by a required reviewer.

Required reviewers with read access to the repository contents and deployments can use this endpoint. Required reviewers must authenticate using an access token with the repo scope to use this endpoint.

environment_ids

array[int]

required

The list of environment ids to approve or reject

Example
[ 161171787, 161171795 ]

state

string

required

Whether to approve or reject deployment to the specified environments.

Enum
  • approved
  • rejected
Example
"approved"

comment

string

required

A comment to accompany the deployment review

Example
"Ship it!"

Request

{
  "environment_ids": [
    161171787
  ],
  "state": "approved",
  "comment": "Ship it!"
}

Response

ExamplesSchema

Response

[
  {
    "url": "https://api.github.com/repos/octocat/example/deployments/1",
    "id": 1,
    "node_id": "MDEwOkRlcGxveW1lbnQx",
    "sha": "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d",
    "ref": "topic-branch",
    "task": "deploy",
    "payload": {},
    "original_environment": "staging",
    "environment": "production",
    "description": "Deploy request from hubot",
    "creator": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "created_at": "2012-07-20T01:19:13Z",
    "updated_at": "2012-07-20T01:19:13Z",
    "statuses_url": "https://api.github.com/repos/octocat/example/deployments/1/statuses",
    "repository_url": "https://api.github.com/repos/octocat/example",
    "transient_environment": false,
    "production_environment": true
  }
]

Re-run a workflow

post /repos/{owner}/{repo}/actions/runs/{run_id}/rerun

Re-runs your workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

enable_debug_logging

boolean

Whether to enable debug logging for the re-run.

Default
false

Request

null

Response

ExamplesSchema

Response

null

Re-run failed jobs from a workflow run

post /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs

Re-run all of the failed jobs and their dependent jobs in a workflow run using the id of the workflow run. You must authenticate using an access token with the repo scope to use this endpoint.

enable_debug_logging

boolean

Whether to enable debug logging for the re-run.

Default
false

Request

null

Response

ExamplesSchema

Response

null

List repository secrets

get /repos/{owner}/{repo}/actions/secrets

Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "secrets": [
    {
      "name": "GH_TOKEN",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "GIST_ID",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

Get a repository public key

get /repos/{owner}/{repo}/actions/secrets/public-key

Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. 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 secrets repository permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

Response

ExamplesSchema

Response

{
  "key_id": "012345678912345678",
  "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}

Get a repository secret

get /repos/{owner}/{repo}/actions/secrets/{secret_name}

Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Response

{
  "name": "GH_TOKEN",
  "created_at": "2019-08-10T14:59:22Z",
  "updated_at": "2020-01-10T14:59:22Z"
}

Create or update a repository secret

put /repos/{owner}/{repo}/actions/secrets/{secret_name}

Creates or updates a repository secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the libsodium-wrappers library.

const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
  // Convert Secret & Base64 key to Uint8Array.
  let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
  let binsec = sodium.from_string(secret)

  //Encrypt the secret using LibSodium
  let encBytes = sodium.crypto_box_seal(binsec, binkey)

  // Convert encrypted Uint8Array to Base64
  let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

  console.log(output)
});

Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public

def encrypt(public_key: str, secret_value: str) -> str:
  """Encrypt a Unicode string using the public key."""
  public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
  sealed_box = public.SealedBox(public_key)
  encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
  return b64encode(encrypted).decode("utf-8")

Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");

var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);

Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));

Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"

key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)

box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")

# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)

encrypted_value

string

^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$

Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint.

key_id

string

ID of the key you used to encrypt the secret.

Request

{
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678"
}

Response

ExamplesSchema

Response when creating a secret

null

Delete a repository secret

delete /repos/{owner}/{repo}/actions/secrets/{secret_name}

Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Response

Empty response

List repository variables

get /repos/{owner}/{repo}/actions/variables

Lists all repository variables. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:read repository permission to use this endpoint.

per_page

int

The number of results per page (max 30).

Default
10

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "variables": [
    {
      "name": "USERNAME",
      "value": "octocat",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "EMAIL",
      "value": "octocat@github.com",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

Create a repository variable

post /repos/{owner}/{repo}/actions/variables

Creates a repository variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:write repository permission to use this endpoint.

name

string

required

The name of the variable.

value

string

required

The value of the variable.

Request

{
  "name": "USERNAME",
  "value": "octocat"
}

Response

ExamplesSchema

Response

null

Get a repository variable

get /repos/{owner}/{repo}/actions/variables/{name}

Gets a specific variable in a repository. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:read repository permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

name

string

required

The name of the variable.

Response

ExamplesSchema

Response

{
  "name": "USERNAME",
  "value": "octocat",
  "created_at": "2021-08-10T14:59:22Z",
  "updated_at": "2022-01-10T14:59:22Z"
}

Delete a repository variable

delete /repos/{owner}/{repo}/actions/variables/{name}

Deletes a repository variable using the variable name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:write repository permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

name

string

required

The name of the variable.

Response

ExamplesSchema

Response

Empty response

Update a repository variable

patch /repos/{owner}/{repo}/actions/variables/{name}

Updates a repository variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions_variables:write repository permission to use this endpoint.

name

string

The name of the variable.

value

string

The value of the variable.

Request

{
  "name": "USERNAME",
  "value": "octocat"
}

Response

ExamplesSchema

Response

Empty response

List repository workflows

get /repos/{owner}/{repo}/actions/workflows

Lists the workflows in a repository. 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.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "workflows": [
    {
      "id": 161335,
      "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
      "name": "CI",
      "path": ".github/workflows/blank.yaml",
      "state": "active",
      "created_at": "2020-01-08T23:48:37.000-08:00",
      "updated_at": "2020-01-08T23:50:21.000-08:00",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335",
      "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
      "badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
    },
    {
      "id": 269289,
      "node_id": "MDE4OldvcmtmbG93IFNlY29uZGFyeTI2OTI4OQ==",
      "name": "Linter",
      "path": ".github/workflows/linter.yaml",
      "state": "active",
      "created_at": "2020-01-08T23:48:37.000-08:00",
      "updated_at": "2020-01-08T23:50:21.000-08:00",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/269289",
      "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/269289",
      "badge_url": "https://github.com/octo-org/octo-repo/workflows/Linter/badge.svg"
    }
  ]
}

Get a workflow

get /repos/{owner}/{repo}/actions/workflows/{workflow_id}

Gets a specific workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. 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.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

workflow_id

One Of

required

The ID of the workflow. You can also pass the workflow file name as a string.

Response

ExamplesSchema

Response

{
  "id": 161335,
  "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
  "name": "CI",
  "path": ".github/workflows/blank.yaml",
  "state": "active",
  "created_at": "2020-01-08T23:48:37.000-08:00",
  "updated_at": "2020-01-08T23:50:21.000-08:00",
  "url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335",
  "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
  "badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
}

Disable a workflow

put /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable

Disables a workflow and sets the state of the workflow to disabled_manually. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

workflow_id

One Of

required

The ID of the workflow. You can also pass the workflow file name as a string.

Response

ExamplesSchema

Response

Empty response

Create a workflow dispatch event

post /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs. The inputs are configured in the workflow file. For more information about how to configure the workflow_dispatch event in the workflow file, see "Events that trigger workflows."

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see "Creating a personal access token for the command line."

ref

string

required

The git reference for the workflow. The reference can be a branch or tag name.

inputs

object (inputs)

Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.

Request

{
  "ref": "topic-branch",
  "inputs": {
    "name": "Mona the Octocat",
    "home": "San Francisco, CA"
  }
}

Response

ExamplesSchema

Response

Empty response

Enable a workflow

put /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable

Enables a workflow and sets the state of the workflow to active. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

owner

string

required

The account owner of the repository. The name is not case sensitive.

repo

string

required

The name of the repository. The name is not case sensitive.

workflow_id

One Of

required

The ID of the workflow. You can also pass the workflow file name as a string.

Response

ExamplesSchema

Response

Empty response

List workflow runs for a workflow

get /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs

List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. 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.

actor

string

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

branch

string

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

event

string

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

status

string

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.

Enum
  • completed
  • action_required
  • cancelled
  • failure
  • neutral
  • skipped
  • stale
  • success
  • timed_out
  • in_progress
  • queued
  • requested
  • waiting
  • pending

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

created

string

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_requests

boolean

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

Default
false

check_suite_id

int

Returns workflow runs with the check_suite_id that you specify.

head_sha

string

Only returns workflow runs that are associated with the specified head_sha.

Response

ExamplesSchema

Response

{
  "total_count": 1,
  "workflow_runs": [
    {
      "id": 30433642,
      "name": "Build",
      "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
      "check_suite_id": 42,
      "check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
      "head_branch": "master",
      "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
      "run_number": 562,
      "event": "push",
      "status": "queued",
      "conclusion": null,
      "workflow_id": 159038,
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
      "html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
      "pull_requests": [],
      "created_at": "2020-01-22T19:33:08Z",
      "updated_at": "2020-01-22T19:33:08Z",
      "actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "run_attempt": 1,
      "run_started_at": "2020-01-22T19:33:08Z",
      "triggering_actor": {
        "login": "octocat",
        "id": 1,
        "node_id": "MDQ6VXNlcjE=",
        "avatar_url": "https://github.com/images/error/octocat_happy.gif",
        "gravatar_id": "",
        "url": "https://api.github.com/users/octocat",
        "html_url": "https://github.com/octocat",
        "followers_url": "https://api.github.com/users/octocat/followers",
        "following_url": "https://api.github.com/users/octocat/following{/other_user}",
        "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
        "organizations_url": "https://api.github.com/users/octocat/orgs",
        "repos_url": "https://api.github.com/users/octocat/repos",
        "events_url": "https://api.github.com/users/octocat/events{/privacy}",
        "received_events_url": "https://api.github.com/users/octocat/received_events",
        "type": "User",
        "site_admin": false
      },
      "jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
      "logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
      "check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
      "artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
      "cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
      "rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
      "workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
      "head_commit": {
        "id": "acb5820ced9479c074f688cc328bf03f341a511d",
        "tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
        "message": "Create linter.yaml",
        "timestamp": "2020-01-22T19:33:05Z",
        "author": {
          "name": "Octo Cat",
          "email": "octocat@github.com"
        },
        "committer": {
          "name": "GitHub",
          "email": "noreply@github.com"
        }
      },
      "repository": {
        "id": 1296269,
        "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
        "name": "Hello-World",
        "full_name": "octocat/Hello-World",
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/octocat/Hello-World",
        "description": "This your first repo!",
        "fork": false,
        "url": "https://api.github.com/repos/octocat/Hello-World",
        "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
        "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
        "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
        "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
        "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
        "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
        "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
        "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
        "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
        "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
        "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
        "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
        "events_url": "https://api.github.com/repos/octocat/Hello-World/events",
        "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
        "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
        "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
        "git_url": "git:github.com/octocat/Hello-World.git",
        "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
        "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
        "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
        "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
        "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
        "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
        "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
        "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
        "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
        "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
        "ssh_url": "git@github.com:octocat/Hello-World.git",
        "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
        "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
        "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
        "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
        "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
        "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
        "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
        "hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
      },
      "head_repository": {
        "id": 217723378,
        "node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
        "name": "octo-repo",
        "full_name": "octo-org/octo-repo",
        "private": true,
        "owner": {
          "login": "octocat",
          "id": 1,
          "node_id": "MDQ6VXNlcjE=",
          "avatar_url": "https://github.com/images/error/octocat_happy.gif",
          "gravatar_id": "",
          "url": "https://api.github.com/users/octocat",
          "html_url": "https://github.com/octocat",
          "followers_url": "https://api.github.com/users/octocat/followers",
          "following_url": "https://api.github.com/users/octocat/following{/other_user}",
          "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
          "organizations_url": "https://api.github.com/users/octocat/orgs",
          "repos_url": "https://api.github.com/users/octocat/repos",
          "events_url": "https://api.github.com/users/octocat/events{/privacy}",
          "received_events_url": "https://api.github.com/users/octocat/received_events",
          "type": "User",
          "site_admin": false
        },
        "html_url": "https://github.com/octo-org/octo-repo",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/octo-org/octo-repo",
        "forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
        "keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
        "hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
        "issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
        "events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
        "assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
        "branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
        "tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
        "blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
        "stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
        "contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
        "subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
        "subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
        "commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
        "compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
        "archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
        "issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
        "pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
        "releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
        "deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
      }
    }
  ]
}

List environment secrets

get /repositories/{repository_id}/environments/{environment_name}/secrets

Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

per_page

int

The number of results per page (max 100).

Default
30

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "secrets": [
    {
      "name": "GH_TOKEN",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "GIST_ID",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

Get an environment public key

get /repositories/{repository_id}/environments/{environment_name}/secrets/public-key

Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. 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 secrets repository permission to use this endpoint.

repository_id

int

required

The unique identifier of the repository.

environment_name

string

required

The name of the environment.

Response

ExamplesSchema

Response

{
  "key_id": "012345678912345678",
  "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}

Get an environment secret

get /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}

Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

repository_id

int

required

The unique identifier of the repository.

environment_name

string

required

The name of the environment.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Response

{
  "name": "GH_TOKEN",
  "created_at": "2019-08-10T14:59:22Z",
  "updated_at": "2020-01-10T14:59:22Z"
}

Create or update an environment secret

put /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}

Creates or updates an environment secret with an encrypted value. Encrypt your secret using LibSodium. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

Example encrypting a secret using Node.js

Encrypt your secret using the libsodium-wrappers library.

const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
  // Convert Secret & Base64 key to Uint8Array.
  let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
  let binsec = sodium.from_string(secret)

  //Encrypt the secret using LibSodium
  let encBytes = sodium.crypto_box_seal(binsec, binkey)

  // Convert encrypted Uint8Array to Base64
  let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

  console.log(output)
});

Example encrypting a secret using Python

Encrypt your secret using pynacl with Python 3.

from base64 import b64encode
from nacl import encoding, public

def encrypt(public_key: str, secret_value: str) -> str:
  """Encrypt a Unicode string using the public key."""
  public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
  sealed_box = public.SealedBox(public_key)
  encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
  return b64encode(encrypted).decode("utf-8")

Example encrypting a secret using C#

Encrypt your secret using the Sodium.Core package.

var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");

var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);

Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));

Example encrypting a secret using Ruby

Encrypt your secret using the rbnacl gem.

require "rbnacl"
require "base64"

key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)

box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")

# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)

encrypted_value

string

^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$

required

Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an environment public key endpoint.

key_id

string

required

ID of the key you used to encrypt the secret.

Request

{
  "encrypted_value": "c2VjcmV0",
  "key_id": "012345678912345678"
}

Response

ExamplesSchema

Response when creating a secret

null

Delete an environment secret

delete /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}

Deletes a secret in an environment using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.

repository_id

int

required

The unique identifier of the repository.

environment_name

string

required

The name of the environment.

secret_name

string

required

The name of the secret.

Response

ExamplesSchema

Default response

Empty response

List environment variables

get /repositories/{repository_id}/environments/{environment_name}/variables

Lists all environment variables. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the environments:read repository permission to use this endpoint.

per_page

int

The number of results per page (max 30).

Default
10

page

int

Page number of the results to fetch.

Default
1

Response

ExamplesSchema

Response

{
  "total_count": 2,
  "variables": [
    {
      "name": "USERNAME",
      "value": "octocat",
      "created_at": "2019-08-10T14:59:22Z",
      "updated_at": "2020-01-10T14:59:22Z"
    },
    {
      "name": "EMAIL",
      "value": "octocat@github.com",
      "created_at": "2020-01-10T10:59:22Z",
      "updated_at": "2020-01-11T11:59:22Z"
    }
  ]
}

Create an environment variable

post /repositories/{repository_id}/environments/{environment_name}/variables

Create an environment variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the environment:write repository permission to use this endpoint.

name

string

required

The name of the variable.

value

string

required

The value of the variable.

Request

{
  "name": "USERNAME",
  "value": "octocat"
}

Response

ExamplesSchema

Response

null

Get an environment variable

get /repositories/{repository_id}/environments/{environment_name}/variables/{name}

Gets a specific variable in an environment. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the environments:read repository permission to use this endpoint.

repository_id

int

required

The unique identifier of the repository.

environment_name

string

required

The name of the environment.

name

string

required

The name of the variable.

Response

ExamplesSchema

Response

{
  "name": "USERNAME",
  "value": "octocat",
  "created_at": "2021-08-10T14:59:22Z",
  "updated_at": "2022-01-10T14:59:22Z"
}

Delete an environment variable

delete /repositories/{repository_id}/environments/{environment_name}/variables/{name}

Deletes an environment variable using the variable name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the environment:write repository permission to use this endpoint.

repository_id

int

required

The unique identifier of the repository.

name

string

required

The name of the variable.

environment_name

string

required

The name of the environment.

Response

ExamplesSchema

Response

Empty response

Update an environment variable

patch /repositories/{repository_id}/environments/{environment_name}/variables/{name}

Updates an environment variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the environment:write repository permission to use this endpoint.

name

string

The name of the variable.

value

string

The value of the variable.

Request

{
  "name": "USERNAME",
  "value": "octocat"
}

Response

ExamplesSchema

Response

Empty response

Was this page helpful?