Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы, возможно, еще выполняется. Актуальные сведения см. в документации на английском языке.
REST API теперь имеет версию. Дополнительные сведения см. в разделе Сведения об управлении версиями API.

GitHub Actions требуемых рабочих процессов

Используйте REST API для доступа и настройки необходимых рабочих процессов в организации в GitHub Actions.

List required workflows

Работа с GitHub Apps

List all required workflows in an organization.

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

For more information, see "Required Workflows."

Параметры для "List required workflows"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

Параметры запроса
Имя, Тип, Описание
per_page integer

The number of results per page (max 100).

Значение по умолчанию: 30

page integer

Page number of the results to fetch.

Значение по умолчанию: 1

Коды состояния HTTP-ответа для "List required workflows"

Код состоянияОписание
200

OK

Примеры кода для "List required workflows"

get/orgs/{org}/actions/required_workflows
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows

Response

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

Create a required workflow

Работа с GitHub Apps

Create a required workflow in an organization.

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

For more information, see "Required Workflows."

Параметры для "Create a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

Параметры запроса
Имя, Тип, Описание
workflow_file_path string Обязательно

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

repository_id string Обязательно

The ID of the repository that contains the workflow file.

scope string

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

Значение по умолчанию: all

Может быть одним из: selected, all

selected_repository_ids array of integers

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

Коды состояния HTTP-ответа для "Create a required workflow"

Код состоянияОписание
201

Created

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Create a required workflow"

post/orgs/{org}/actions/required_workflows
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows \ -d '{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}'

Response

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

Get a required workflow

Работа с GitHub Apps

Get a required workflow configured in an organization.

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

For more information, see "Required Workflows."

Параметры для "Get a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

Коды состояния HTTP-ответа для "Get a required workflow"

Код состоянияОписание
200

OK

Примеры кода для "Get a required workflow"

get/orgs/{org}/actions/required_workflows/{required_workflow_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID

Response

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

Update a required workflow

Работа с GitHub Apps

Update a required workflow in an organization.

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

For more information, see "Required Workflows."

Параметры для "Update a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

Параметры запроса
Имя, Тип, Описание
workflow_file_path string

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

repository_id string

The ID of the repository that contains the workflow file.

scope string

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

Значение по умолчанию: all

Может быть одним из: selected, all

selected_repository_ids array of integers

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

Коды состояния HTTP-ответа для "Update a required workflow"

Код состоянияОписание
200

OK

422

Validation failed, or the endpoint has been spammed.

Примеры кода для "Update a required workflow"

patch/orgs/{org}/actions/required_workflows/{required_workflow_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID \ -d '{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}'

Response

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

Delete a required workflow

Работа с GitHub Apps

Deletes a required workflow configured in an organization.

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

For more information, see "Required Workflows."

Параметры для "Delete a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

Коды состояния HTTP-ответа для "Delete a required workflow"

Код состоянияОписание
204

No Content

Примеры кода для "Delete a required workflow"

delete/orgs/{org}/actions/required_workflows/{required_workflow_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID

Response

Status: 204

List selected repositories for a required workflow

Работа с GitHub Apps

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

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

For more information, see "Required Workflows."

Параметры для "List selected repositories for a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

Коды состояния HTTP-ответа для "List selected repositories for a required workflow"

Код состоянияОписание
200

Success

404

Resource Not Found

Примеры кода для "List selected repositories for a required workflow"

get/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID/repositories

Success

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

Sets repositories for a required workflow

Работа с GitHub Apps

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

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

For more information, see "Required Workflows."

Параметры для "Sets repositories for a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

Параметры запроса
Имя, Тип, Описание
selected_repository_ids array of integers Обязательно

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

Коды состояния HTTP-ответа для "Sets repositories for a required workflow"

Код состоянияОписание
204

No Content

Примеры кода для "Sets repositories for a required workflow"

put/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID/repositories \ -d '{"selected_repository_ids":[32,91]}'

Response

Status: 204

Add a repository to a required workflow

Работа с GitHub Apps

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

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

For more information, see "Required Workflows."

Параметры для "Add a repository to a required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

repository_id integer Обязательно

The unique identifier of the repository.

Коды состояния HTTP-ответа для "Add a repository to a required workflow"

Код состоянияОписание
204

Success

404

Resource Not Found

422

Validation Error

Примеры кода для "Add a repository to a required workflow"

put/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID/repositories/REPOSITORY_ID

Success

Status: 204

Remove a selected repository from required workflow

Работа с GitHub Apps

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

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

For more information, see "Required Workflows."

Параметры для "Remove a selected repository from required workflow"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

required_workflow_id integer Обязательно

The unique identifier of the required workflow.

repository_id integer Обязательно

The unique identifier of the repository.

Коды состояния HTTP-ответа для "Remove a selected repository from required workflow"

Код состоянияОписание
204

Success

404

Resource Not Found

422

Validation Error

Примеры кода для "Remove a selected repository from required workflow"

delete/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/actions/required_workflows/REQUIRED_WORKFLOW_ID/repositories/REPOSITORY_ID

Success

Status: 204

List repository required workflows

Работа с GitHub Apps

Lists the required workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. For more information, see "Required Workflows."

Параметры для "List repository required workflows"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

repo string Обязательно

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

Параметры запроса
Имя, Тип, Описание
per_page integer

The number of results per page (max 100).

Значение по умолчанию: 30

page integer

Page number of the results to fetch.

Значение по умолчанию: 1

Коды состояния HTTP-ответа для "List repository required workflows"

Код состоянияОписание
200

OK

404

Resource not found

Примеры кода для "List repository required workflows"

get/repos/{org}/{repo}/actions/required_workflows
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/ORG/REPO/actions/required_workflows

Response

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

Get a required workflow entity for a repository

Работа с GitHub Apps

Gets a specific required workflow present in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. For more information, see "Required Workflows."

Параметры для "Get a required workflow entity for a repository"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

repo string Обязательно

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

required_workflow_id_for_repo integer Обязательно

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

Коды состояния HTTP-ответа для "Get a required workflow entity for a repository"

Код состоянияОписание
200

OK

404

Resource not found

Примеры кода для "Get a required workflow entity for a repository"

get/repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/ORG/REPO/actions/required_workflows/REQUIRED_WORKFLOW_ID_FOR_REPO

Response

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

Get required workflow usage

Gets the number of billable minutes used by a specific required workflow during the current billing cycle.

Billable minutes only apply to required workflows running 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 required workflow usage"

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

repo string Обязательно

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

required_workflow_id_for_repo integer Обязательно

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

Коды состояния HTTP-ответа для "Get required workflow usage"

Код состоянияОписание
200

OK

404

Resource not found

Примеры кода для "Get required workflow usage"

get/repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/timing
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>"\ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/ORG/REPO/actions/required_workflows/REQUIRED_WORKFLOW_ID_FOR_REPO/timing

Response

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