ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。
記事のバージョン: Free, Pro, and Team
記事のバージョン: Free, Pro, and Team

アクション

GitHub ActionsはGitHub Free、GitHub Pro、GitHub FreeのOrganization、GitHub Team、GitHub Enterprise Cloud、GitHub Oneで利用できます。 GitHub Actionsは、レガシーのリポジトリごとのプランを使っているアカウントが所有しているプライベートリポジトリでは利用できません。 For more information, see "GitHub's products."

ここには以下の内容があります:

GitHub Actions API では、REST API を使用して GitHub Actions を管理できます。 This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub App には、各エンドポイントで指定されている権限が必要です。 詳しい情報については、「GitHub Actions のドキュメント」を参照してください。

成果物

成果物 API では、ワークフローの成果物に関する情報をダウンロード、削除、および取得できます。 Artifacts enable you to share data between jobs in a workflow and store data once that workflow has completed. 詳しい情報については、「成果物を利用してワークフローのデータを永続化する」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub Apps must have the actions permission to use this API.

List artifacts for a repository

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/artifacts
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/artifacts', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
{
  "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"
    },
    {
      "id": 13,
      "node_id": "MDg6QXJ0aWZhY3QxMw==",
      "name": "",
      "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"
    }
  ]
}

Notes


Get an artifact

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
artifact_id integer path

artifact_id parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/artifacts/42
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  artifact_id: 42
})

Default response

Status: 200 OK
{
  "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"
}

Notes


Delete an artifact

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
artifact_id integer path

artifact_id parameter

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/artifacts/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  artifact_id: 42
})

Default Response

Status: 204 No Content

Notes


Download an artifact

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
artifact_id integer path

artifact_id parameter

archive_format string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/artifacts/42/ARCHIVE_FORMAT
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', {
  owner: 'octocat',
  repo: 'hello-world',
  artifact_id: 42,
  archive_format: 'archive_format'
})

Response

Status: 302 Found

Notes


List workflow run 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/artifacts
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default response

Status: 200 OK
{
  "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"
    },
    {
      "id": 13,
      "node_id": "MDg6QXJ0aWZhY3QxMw==",
      "name": "",
      "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"
    }
  ]
}

Notes


権限

The Permissions API allows you to set permissions for what organizations and repositories are allowed to run GitHub Actions, and what actions are allowed to run. 詳しい情報については、「使用制限、支払い、および管理」を参照してください。

You can also set permissions for an enterprise. 詳しい情報については、「GitHub Enterprise 管理」REST API を参照してください。

Get GitHub Actions permissions for an organization

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.

get /orgs/{org}/actions/permissions

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/permissions', {
  org: 'org'
})

Default response

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

Notes


Set GitHub Actions permissions for an organization

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.

put /orgs/{org}/actions/permissions

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
enabled_repositories string body

Required. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: all, none, or selected.

allowed_actions string body

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

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions \
  -d '{"enabled_repositories":"enabled_repositories"}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/permissions', {
  org: 'org',
  enabled_repositories: 'enabled_repositories'
})

Default Response

Status: 204 No Content

Notes


List selected repositories enabled for GitHub Actions in an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/repositories
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/permissions/repositories', {
  org: 'org'
})

Default response

Status: 200 OK
{
  "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,
      "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
    }
  ]
}

Notes


Set selected repositories enabled for GitHub Actions in an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
selected_repository_ids array of integers body

Required. List of repository IDs to enable for GitHub Actions.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/repositories \
  -d '{"selected_repository_ids":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/permissions/repositories', {
  org: 'org',
  selected_repository_ids: [
    42
  ]
})

Default Response

Status: 204 No Content

Notes


Enable a selected repository for GitHub Actions in an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
repository_id integer path

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/permissions/repositories/{repository_id}', {
  org: 'org',
  repository_id: 42
})

Default Response

Status: 204 No Content

Notes


Disable a selected repository for GitHub Actions in an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
repository_id integer path

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}', {
  org: 'org',
  repository_id: 42
})

Default Response

Status: 204 No Content

Notes


Get allowed actions for an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/selected-actions
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/permissions/selected-actions', {
  org: 'org'
})

Default response

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

Notes


Set allowed actions for an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
github_owned_allowed boolean body

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

verified_allowed boolean body

Whether actions in GitHub Marketplace from verified creators are allowed. Set to true to allow all GitHub Marketplace actions by verified creators.

patterns_allowed array of strings body

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/*."

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/permissions/selected-actions \
  -d '{"github_owned_allowed":true}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/permissions/selected-actions', {
  org: 'org',
  github_owned_allowed: true
})

Default Response

Status: 204 No Content

Notes


Get GitHub Actions permissions for a repository

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/permissions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/permissions', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

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

Notes


Set GitHub Actions permissions for a repository

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

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
enabled boolean body

Required. Whether GitHub Actions is enabled on the repository.

allowed_actions string body

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

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/permissions \
  -d '{"enabled":true}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions', {
  owner: 'octocat',
  repo: 'hello-world',
  enabled: true
})

Default Response

Status: 204 No Content

Notes


Get allowed actions for a repository

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/permissions/selected-actions
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/permissions/selected-actions', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

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

Notes


Set allowed actions for a repository

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

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

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
github_owned_allowed boolean body

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

verified_allowed boolean body

Whether actions in GitHub Marketplace from verified creators are allowed. Set to true to allow all GitHub Marketplace actions by verified creators.

patterns_allowed array of strings body

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/*."

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/permissions/selected-actions \
  -d '{"github_owned_allowed":true}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions/selected-actions', {
  owner: 'octocat',
  repo: 'hello-world',
  github_owned_allowed: true
})

Default Response

Status: 204 No Content

Notes


シークレット

シークレット API では、暗号化されたシークレットに関する情報を作成、更新、削除、および取得できます。 Encrypted secrets allow you to store sensitive information, such as access tokens, in your repository or organization. 詳しい情報については、「暗号化されたシークレットの作成と利用」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub App には、この API を使用するための secrets 権限が必要です。 認証されたユーザは、シークレットを作成、更新、または読み取るために、リポジトリへのコラボレータアクセス権を持っている必要があります。

List organization 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.

get /orgs/{org}/actions/secrets

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/secrets', {
  org: 'org'
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Get an organization 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/public-key
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/secrets/public-key', {
  org: 'org'
})

Default response

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

Notes


Get an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/secrets/{secret_name}', {
  org: 'org',
  secret_name: 'secret_name'
})

Default response

Status: 200 OK
{
  "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"
}

Notes


Create or update an organization secret

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 tweetsodium library.

const sodium = require('tweetsodium');

const key = "base64-encoded-public-key"; const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64');

// Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes);

// Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64');

console.log(encrypted);

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)

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

encrypted_value string body

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

key_id string body

ID of the key you used to encrypt the secret.

visibility string body

Configures the access that repositories have to the organization secret. Can be one of:
- all - All repositories in an organization can access the secret.
- private - Private repositories in an organization can access the secret.
- selected - Only specific repositories can access the secret.

selected_repository_ids array of strings body

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.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME \
  -d '{"encrypted_value":"encrypted_value"}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}', {
  org: 'org',
  secret_name: 'secret_name',
  encrypted_value: 'encrypted_value'
})

Response when creating a secret

Status: 201 Created

Response when updating a secret

Status: 204 No Content

Notes


Delete an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/secrets/{secret_name}', {
  org: 'org',
  secret_name: 'secret_name'
})

Default Response

Status: 204 No Content

Notes


List selected repositories for an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/secrets/{secret_name}/repositories', {
  org: 'org',
  secret_name: 'secret_name'
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Set selected repositories for an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

selected_repository_ids array of integers body

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 Set selected repositories for an organization secret and Remove selected repository from an organization secret endpoints.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories \
  -d '{"selected_repository_ids":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}/repositories', {
  org: 'org',
  secret_name: 'secret_name',
  selected_repository_ids: [
    42
  ]
})

Default Response

Status: 204 No Content

Notes


Add selected repository to an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

repository_id integer path

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}', {
  org: 'org',
  secret_name: 'secret_name',
  repository_id: 42
})

Response when repository was added to the selected list

Status: 204 No Content

Response when visibility type is not set to selected

Status: 409 Conflict

Notes


Remove selected repository from an organization secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
secret_name string path

secret_name parameter

repository_id integer path

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}', {
  org: 'org',
  secret_name: 'secret_name',
  repository_id: 42
})

Response when repository was removed from the selected list

Status: 204 No Content

Response when visibility type not set to selected

Status: 409 Conflict

Notes


List repository 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/secrets
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/secrets', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Get a repository 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/secrets/public-key
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/secrets/public-key', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

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

Notes


Get a repository secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
secret_name string path

secret_name parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/secrets/SECRET_NAME
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
  owner: 'octocat',
  repo: 'hello-world',
  secret_name: 'secret_name'
})

Default response

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

Notes


Create or update a repository secret

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 tweetsodium library.

const sodium = require('tweetsodium');

const key = "base64-encoded-public-key"; const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64');

// Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes);

// Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64');

console.log(encrypted);

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)

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
secret_name string path

secret_name parameter

encrypted_value string body

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

key_id string body

ID of the key you used to encrypt the secret.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/secrets/SECRET_NAME \
  -d '{"encrypted_value":"encrypted_value"}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
  owner: 'octocat',
  repo: 'hello-world',
  secret_name: 'secret_name',
  encrypted_value: 'encrypted_value'
})

Response when creating a secret

Status: 201 Created

Response when updating a secret

Status: 204 No Content

Notes


Delete a repository secret

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
secret_name string path

secret_name parameter

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/secrets/SECRET_NAME
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
  owner: 'octocat',
  repo: 'hello-world',
  secret_name: 'secret_name'
})

Default Response

Status: 204 No Content

Notes


セルフホストランナー

セルフホストランナー API では、自分のホストランナーの登録、表示、削除ができます。 Self-hosted runners allow you to host your own runners and customize the environment used to run jobs in your GitHub Actions workflows. 詳しい情報については「自分のランナーのホスト」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub App には、リポジトリの administration 権限または Organization の organization_self_hosted_runners 権限が必要です。 認証されたユーザがこの API を使用するには、リポジトリまたは Organization への管理者アクセス権が必要です。

Enterprise のセルフホストランナーを管理できます。 詳しい情報については、「GitHub Enterprise 管理」REST API を参照してください。

List self-hosted runners for an organization

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.

get /orgs/{org}/actions/runners

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runners', {
  org: 'org'
})

Default response

Status: 200 OK
{
  "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"
        }
      ]
    }
  ]
}

Notes


List runner applications for an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners/downloads
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runners/downloads', {
  org: 'org'
})

Default response

Status: 200 OK
[
  {
    "os": "osx",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz",
    "filename": "actions-runner-osx-x64-2.164.0.tar.gz"
  },
  {
    "os": "linux",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz",
    "filename": "actions-runner-linux-x64-2.164.0.tar.gz"
  },
  {
    "os": "linux",
    "architecture": "arm",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz",
    "filename": "actions-runner-linux-arm-2.164.0.tar.gz"
  },
  {
    "os": "win",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip",
    "filename": "actions-runner-win-x64-2.164.0.zip"
  },
  {
    "os": "linux",
    "architecture": "arm64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz",
    "filename": "actions-runner-linux-arm64-2.164.0.tar.gz"
  }
]

Notes


Create a registration token for an organization

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
post /orgs/{org}/actions/runners/registration-token

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners/registration-token
JavaScript (@octokit/core.js)
await octokit.request('POST /orgs/{org}/actions/runners/registration-token', {
  org: 'org'
})

Default response

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

Notes


Create a remove token for an organization

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
post /orgs/{org}/actions/runners/remove-token

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners/remove-token
JavaScript (@octokit/core.js)
await octokit.request('POST /orgs/{org}/actions/runners/remove-token', {
  org: 'org'
})

Default response

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

Notes


Get a self-hosted runner for an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runners/{runner_id}', {
  org: 'org',
  runner_id: 42
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Delete a self-hosted runner from an organization

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/runners/{runner_id}', {
  org: 'org',
  runner_id: 42
})

Default Response

Status: 204 No Content

Notes


List self-hosted runners for a repository

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runners', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
{
  "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"
        }
      ]
    }
  ]
}

Notes


List runner applications for a repository

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners/downloads
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runners/downloads', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
[
  {
    "os": "osx",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz",
    "filename": "actions-runner-osx-x64-2.164.0.tar.gz"
  },
  {
    "os": "linux",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz",
    "filename": "actions-runner-linux-x64-2.164.0.tar.gz"
  },
  {
    "os": "linux",
    "architecture": "arm",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz",
    "filename": "actions-runner-linux-arm-2.164.0.tar.gz"
  },
  {
    "os": "win",
    "architecture": "x64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip",
    "filename": "actions-runner-win-x64-2.164.0.zip"
  },
  {
    "os": "linux",
    "architecture": "arm64",
    "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz",
    "filename": "actions-runner-linux-arm64-2.164.0.tar.gz"
  }
]

Notes


Create a registration token for a repository

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

Example using registration token

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners/registration-token
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/actions/runners/registration-token', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

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

Notes


Create a remove token for a repository

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

Example using remove token

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

./config.sh remove --token TOKEN
post /repos/{owner}/{repo}/actions/runners/remove-token

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners/remove-token
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/actions/runners/remove-token', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

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

Notes


Get a self-hosted runner for a repository

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runners/{runner_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  runner_id: 42
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Delete a self-hosted runner from a repository

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  runner_id: 42
})

Default Response

Status: 204 No Content

Notes


セルフホストランナーグループ

セルフホストランナーグループ API を使用すると、セルフホストランナーのグループを管理できます。 詳しい情報については、「グループを使用したセルフホストランナーへのアクセスを管理する」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub App には、リポジトリの administration 権限または Organization の organization_self_hosted_runners 権限が必要です。 認証されたユーザがこの API を使用するには、リポジトリまたは Organization への管理者アクセス権が必要です。

Enterprise のセルフホストランナーグループを管理できます。 詳しい情報については、「GitHub Enterprise 管理」REST API を参照してください。

List self-hosted runner groups for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runner-groups', {
  org: 'org'
})

Default response

Status: 200 OK
{
  "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
    },
    {
      "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
    },
    {
      "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
    }
  ]
}

Notes


Create a self-hosted runner group for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
name string body

Required. Name of the runner group.

visibility string body

Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: all, selected, or private.

Default: all
selected_repository_ids array of integers body

List of repository IDs that can access the runner group.

runners array of integers body

List of runner IDs to add to the runner group.

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups \
  -d '{"name":"name"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /orgs/{org}/actions/runner-groups', {
  org: 'org',
  name: 'name'
})

Default response

Status: 201 Created
{
  "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
}

Notes


Get a self-hosted runner group for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}', {
  org: 'org',
  runner_group_id: 42
})

Default response

Status: 200 OK
{
  "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
}

Notes


Update a self-hosted runner group for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

name string body

Name of the runner group.

visibility string body

Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: all, selected, or private.

コードサンプル

Shell
curl \
  -X PATCH \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42 \
  -d '{"name":"name"}'
JavaScript (@octokit/core.js)
await octokit.request('PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}', {
  org: 'org',
  runner_group_id: 42,
  name: 'name'
})

Default response

Status: 200 OK
{
  "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
}

Notes


Delete a self-hosted runner group from an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}', {
  org: 'org',
  runner_group_id: 42
})

Default Response

Status: 204 No Content

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/repositories
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories', {
  org: 'org',
  runner_group_id: 42
})

Default response

Status: 200 OK
{
  "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,
      "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
    }
  ]
}

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

selected_repository_ids array of integers body

Required. List of repository IDs that can access the runner group.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/repositories \
  -d '{"selected_repository_ids":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories', {
  org: 'org',
  runner_group_id: 42,
  selected_repository_ids: [
    42
  ]
})

Default Response

Status: 204 No Content

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

repository_id integer path

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}', {
  org: 'org',
  runner_group_id: 42,
  repository_id: 42
})

Default Response

Status: 204 No Content

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

repository_id integer path

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/repositories/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}', {
  org: 'org',
  runner_group_id: 42,
  repository_id: 42
})

Default Response

Status: 204 No Content

Notes


List self-hosted runners in a group for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/runners
JavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners', {
  org: 'org',
  runner_group_id: 42
})

Default response

Status: 200 OK
{
  "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"
        }
      ]
    }
  ]
}

Notes


Set self-hosted runners in a group for an organization

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

runners array of integers body

Required. List of runner IDs to add to the runner group.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/runners \
  -d '{"runners":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners', {
  org: 'org',
  runner_group_id: 42,
  runners: [
    42
  ]
})

Default Response

Status: 204 No Content

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/runners/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
  org: 'org',
  runner_group_id: 42,
  runner_id: 42
})

Default Response

Status: 204 No Content

Notes


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

The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

org string path
runner_group_id integer path

Unique identifier of the self-hosted runner group.

runner_id integer path

Unique identifier of the self-hosted runner.

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runner-groups/42/runners/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
  org: 'org',
  runner_group_id: 42,
  runner_id: 42
})

Default Response

Status: 204 No Content

Notes


ワークフロー

ワークフロー API を使用すると、リポジトリのワークフローを表示できます。 Workflows automate your software development life cycle with a wide range of tools and services.詳しい情報については、「GitHub Actions でワークフローを自動化する」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub Apps must have the actions permission to use this API.

List repository 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/workflows', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
{
  "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"
    }
  ]
}

Notes


Get a workflow

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42
})

Default response

Status: 200 OK
{
  "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"
}

Notes


Disable a workflow

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42/disable
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42
})

Default Response

Status: 204 No Content

Notes


Create a workflow dispatch event

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."

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

ref string body

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

inputs object body

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.

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42/dispatches \
  -d '{"ref":"ref"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42,
  ref: 'ref'
})

Default Response

Status: 204 No Content

Notes


Enable a workflow

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

コードサンプル

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42/enable
JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42
})

Default Response

Status: 204 No Content

Notes


Get workflow usage

Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42/timing
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42
})

Default response

Status: 200 OK
{
  "billable": {
    "UBUNTU": {
      "total_ms": 180000
    },
    "MACOS": {
      "total_ms": 240000
    },
    "WINDOWS": {
      "total_ms": 300000
    }
  }
}

ワークフロージョブ

ワークフロージョブ API では、ログとワークフロージョブを表示できます。 A workflow job is a set of steps that execute on the same runner.詳しい情報については、「GitHub Actions のワークフロー構文」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub Apps must have the actions permission to use this API.

Get a job for a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
job_id integer path

job_id parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/jobs/42
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/jobs/{job_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  job_id: 42
})

Default response

Status: 202 Accepted
{
  "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@v2",
      "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@v2",
      "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"
}

Notes


Download job logs for a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
job_id integer path

job_id parameter

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/jobs/42/logs
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs', {
  owner: 'octocat',
  repo: 'hello-world',
  job_id: 42
})

Response

Status: 302 Found

Notes


List jobs for a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path
filter string query

Filters jobs by their completed_at timestamp. Can be one of:
* 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.

per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/jobs
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default response

Status: 200 OK
{
  "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@v2",
          "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@v2",
          "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"
    }
  ]
}

Notes


ワークフロー実行

ワークフロー実行 API では、ワークフロー実行のログを表示、再実行、キャンセル、表示できます。 A workflow run is an instance of your workflow that runs when the pre-configured event occurs.詳しい情報については、「ワークフロー実行を管理する」を参照してください。

This API is available for authenticated users, OAuth Apps, and GitHub Apps. Access tokens require repo scope for private repos and public_repo scope for public repos. GitHub Apps must have the actions permission to use this API.

List workflow runs for a repository

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

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
actor string query

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 query

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

event string query

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 query

Returns workflow runs associated with the check run status or conclusion you specify. For example, a conclusion can be success or a status can be completed. For more information, see the status and conclusion options available in "Create a check run."

per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs', {
  owner: 'octocat',
  repo: 'hello-world'
})

Default response

Status: 200 OK
{
  "total_count": 1,
  "workflow_runs": [
    {
      "id": 30433642,
      "name": "Build",
      "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
      "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",
      "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"
      }
    }
  ]
}

Notes


Get a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default response

Status: 200 OK
{
  "id": 30433642,
  "name": "Build",
  "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
  "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",
  "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"
  }
}

Notes


Delete a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/actions/runs/{run_id}', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default Response

Status: 204 No Content

Notes


Cancel a workflow run

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/cancel
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Response

Status: 202 Accepted

Notes


Download workflow run 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/logs
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Response

Status: 302 Found

Notes


Delete workflow run 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/logs
JavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default Response

Status: 204 No Content

Notes


Re-run a workflow

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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/rerun
JavaScript (@octokit/core.js)
await octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Response

Status: 201 Created

Get workflow run usage

Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".

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

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
run_id integer path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/runs/42/timing
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing', {
  owner: 'octocat',
  repo: 'hello-world',
  run_id: 42
})

Default response

Status: 200 OK
{
  "billable": {
    "UBUNTU": {
      "total_ms": 180000,
      "jobs": 1
    },
    "MACOS": {
      "total_ms": 240000,
      "jobs": 4
    },
    "WINDOWS": {
      "total_ms": 300000,
      "jobs": 2
    }
  },
  "run_duration_ms": 500000
}

List workflow 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.

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

パラメータ

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

owner string path
repo string path
workflow_id path

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

actor string query

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 query

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

event string query

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 query

Returns workflow runs associated with the check run status or conclusion you specify. For example, a conclusion can be success or a status can be completed. For more information, see the status and conclusion options available in "Create a check run."

per_page integer query

Results per page (max 100)

page integer query

Page number of the results to fetch.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/octocat/hello-world/actions/workflows/42/runs
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs', {
  owner: 'octocat',
  repo: 'hello-world',
  workflow_id: 42
})

Default response

Status: 200 OK
{
  "total_count": 1,
  "workflow_runs": [
    {
      "id": 30433642,
      "name": "Build",
      "node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
      "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",
      "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"
      }
    }
  ]
}

Notes


Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

OR, learn how to contribute.