Skip to main content
Wir veröffentlichen regelmäßig Aktualisierungen unserer Dokumentation, und die Übersetzung dieser Seite ist möglicherweise noch nicht abgeschlossen. Aktuelle Informationen findest du in der englischsprachigen Dokumentation.
Die REST-API verfügt jetzt über eine Versionskontrolle. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

Erforderliche Workflows in GitHub Actions

Verwende die REST-API, um auf erforderliche Workflows in einer Organisation in GitHub Actions zuzugreifen und diese zu konfigurieren.

List required workflows

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

Parameter für „List required workflows“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

Page number of the results to fetch.

Standard: 1

HTTP-Antwortstatuscodes für „List required workflows“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „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

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

Parameter für „Create a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Textparameter
Name, type, BESCHREIBUNG
workflow_file_path string Erforderlich

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

repository_id string Erforderlich

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.

Standard: all

Kann eine der Folgenden sein: 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-Antwortstatuscodes für „Create a required workflow“

StatuscodeBESCHREIBUNG
201

Created

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „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

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

Parameter für „Get a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

HTTP-Antwortstatuscodes für „Get a required workflow“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „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

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

Parameter für „Update a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

Textparameter
Name, type, BESCHREIBUNG
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.

Standard: all

Kann eine der Folgenden sein: 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-Antwortstatuscodes für „Update a required workflow“

StatuscodeBESCHREIBUNG
200

OK

422

Validation failed, or the endpoint has been spammed.

Codebeispiele für „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

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

Parameter für „Delete a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

HTTP-Antwortstatuscodes für „Delete a required workflow“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „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

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

Parameter für „List selected repositories for a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

HTTP-Antwortstatuscodes für „List selected repositories for a required workflow“

StatuscodeBESCHREIBUNG
200

Success

404

Resource Not Found

Codebeispiele für „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

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

Parameter für „Sets repositories for a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

Textparameter
Name, type, BESCHREIBUNG
selected_repository_ids array of integers Erforderlich

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

HTTP-Antwortstatuscodes für „Sets repositories for a required workflow“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „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

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

Parameter für „Add a repository to a required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

repository_id integer Erforderlich

The unique identifier of the repository.

HTTP-Antwortstatuscodes für „Add a repository to a required workflow“

StatuscodeBESCHREIBUNG
204

Success

404

Resource Not Found

422

Validation Error

Codebeispiele für „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

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

Parameter für „Remove a selected repository from required workflow“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

required_workflow_id integer Erforderlich

The unique identifier of the required workflow.

repository_id integer Erforderlich

The unique identifier of the repository.

HTTP-Antwortstatuscodes für „Remove a selected repository from required workflow“

StatuscodeBESCHREIBUNG
204

Success

404

Resource Not Found

422

Validation Error

Codebeispiele für „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

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

Parameter für „List repository required workflows“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

repo string Erforderlich

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

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

Page number of the results to fetch.

Standard: 1

HTTP-Antwortstatuscodes für „List repository required workflows“

StatuscodeBESCHREIBUNG
200

OK

404

Resource not found

Codebeispiele für „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

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

Parameter für „Get a required workflow entity for a repository“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

repo string Erforderlich

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

required_workflow_id_for_repo integer Erforderlich

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

HTTP-Antwortstatuscodes für „Get a required workflow entity for a repository“

StatuscodeBESCHREIBUNG
200

OK

404

Resource not found

Codebeispiele für „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.

Parameter für „Get required workflow usage“

Header
Name, type, BESCHREIBUNG
accept string

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

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

repo string Erforderlich

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

required_workflow_id_for_repo integer Erforderlich

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

HTTP-Antwortstatuscodes für „Get required workflow usage“

StatuscodeBESCHREIBUNG
200

OK

404

Resource not found

Codebeispiele für „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 } } }