Skip to main content
Publicamos atualizações frequentes em nossa documentação, e a tradução desta página ainda pode estar em andamento. Para obter as informações mais atualizadas, acesse a documentação em inglês.
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Fluxos de Trabalho Necessários do GitHub Actions

Use a API REST para acessar e configurar os fluxos de trabalho necessários em uma organização do GitHub Actions.

List required workflows

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

Parâmetros para "List required workflows"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100).

Padrão: 30

page integer

Page number of the results to fetch.

Padrão: 1

Códigos de status de resposta HTTP para "List required workflows"

Código de statusDescrição
200

OK

Exemplos de código para "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

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

Parâmetros para "Create a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros do corpo
Nome, Tipo, Descrição
workflow_file_path string Obrigatório

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

repository_id string Obrigatório

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.

Padrão: all

Pode ser um dos: 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.

Códigos de status de resposta HTTP para "Create a required workflow"

Código de statusDescrição
201

Created

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "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

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

Parâmetros para "Get a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

Códigos de status de resposta HTTP para "Get a required workflow"

Código de statusDescrição
200

OK

Exemplos de código para "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

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

Parâmetros para "Update a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

Parâmetros do corpo
Nome, Tipo, Descrição
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.

Padrão: all

Pode ser um dos: 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.

Códigos de status de resposta HTTP para "Update a required workflow"

Código de statusDescrição
200

OK

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "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

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

Parâmetros para "Delete a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

Códigos de status de resposta HTTP para "Delete a required workflow"

Código de statusDescrição
204

No Content

Exemplos de código para "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

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

Parâmetros para "List selected repositories for a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

Códigos de status de resposta HTTP para "List selected repositories for a required workflow"

Código de statusDescrição
200

Success

404

Resource Not Found

Exemplos de código para "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

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

Parâmetros para "Sets repositories for a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

Parâmetros do corpo
Nome, Tipo, Descrição
selected_repository_ids array of integers Obrigatório

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

Códigos de status de resposta HTTP para "Sets repositories for a required workflow"

Código de statusDescrição
204

No Content

Exemplos de código para "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

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

Parâmetros para "Add a repository to a required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

repository_id integer Obrigatório

The unique identifier of the repository.

Códigos de status de resposta HTTP para "Add a repository to a required workflow"

Código de statusDescrição
204

Success

404

Resource Not Found

422

Validation Error

Exemplos de código para "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

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

Parâmetros para "Remove a selected repository from required workflow"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

required_workflow_id integer Obrigatório

The unique identifier of the required workflow.

repository_id integer Obrigatório

The unique identifier of the repository.

Códigos de status de resposta HTTP para "Remove a selected repository from required workflow"

Código de statusDescrição
204

Success

404

Resource Not Found

422

Validation Error

Exemplos de código para "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

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

Parâmetros para "List repository required workflows"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

repo string Obrigatório

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

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

The number of results per page (max 100).

Padrão: 30

page integer

Page number of the results to fetch.

Padrão: 1

Códigos de status de resposta HTTP para "List repository required workflows"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "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

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

Parâmetros para "Get a required workflow entity for a repository"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

repo string Obrigatório

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

required_workflow_id_for_repo integer Obrigatório

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

Códigos de status de resposta HTTP para "Get a required workflow entity for a repository"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "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 Enterprise Cloud-hosted runners. Usage is listed for each GitHub Enterprise Cloud-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.

Parâmetros para "Get required workflow usage"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

repo string Obrigatório

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

required_workflow_id_for_repo integer Obrigatório

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

Códigos de status de resposta HTTP para "Get required workflow usage"

Código de statusDescrição
200

OK

404

Resource not found

Exemplos de código para "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 } } }