Cette version de GitHub Enterprise Server n'est plus disponible depuis le 2024-09-25. Aucune publication de correctifs n’est effectuée, même pour les problèmes de sécurité critiques. Pour de meilleures performances, une sécurité améliorée et de nouvelles fonctionnalités, effectuez une mise à niveau vers la dernière version de GitHub Enterprise. Pour obtenir de l’aide sur la mise à niveau, contactez le support GitHub Enterprise.
Points de terminaison d’API REST pour les autorisations GitHub Actions
Utilisez l’API REST pour interagir avec les autorisations pour GitHub Actions.
À propos des autorisations pour GitHub Actions
Vous pouvez utiliser l’API REST pour définir des autorisations pour les entreprises, les organisations et les référentiels autorisés à exécuter GitHub Actions, ainsi que les actions qui sont autorisés à s’exécuter. Pour plus d’informations, consultez « Limites d’utilisation, facturation et administration ».
Get GitHub Actions permissions for an enterprise
Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Get GitHub Actions permissions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Get GitHub Actions permissions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Codes d’état de la réponse HTTP pour « Get GitHub Actions permissions for an enterprise »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get GitHub Actions permissions for an enterprise »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions
Response
Status: 200
{
"enabled_organizations": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://HOSTNAME/enterprises/2/actions/permissions/selected-actions"
}
Set GitHub Actions permissions for an enterprise
Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Set GitHub Actions permissions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Set GitHub Actions permissions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nom, Type, Description |
---|
enabled_organizations string ObligatoireThe policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Peut être: |
allowed_actions string The permissions policy that controls the actions that are allowed to run. Peut être: |
Codes d’état de la réponse HTTP pour « Set GitHub Actions permissions for an enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set GitHub Actions permissions for an enterprise »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions \
-d '{"enabled_organizations":"all","allowed_actions":"selected"}'
Response
Status: 204
List selected organizations enabled for GitHub Actions in an enterprise
Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « List selected organizations enabled for GitHub Actions in an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « List selected organizations enabled for GitHub Actions in an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nom, Type, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List selected organizations enabled for GitHub Actions in an enterprise »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « List selected organizations enabled for GitHub Actions in an enterprise »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/organizations
Response
Status: 200
{
"total_count": 1,
"organizations": [
{
"login": "octocat",
"id": 161335,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"url": "https://HOSTNAME/orgs/octo-org",
"repos_url": "https://HOSTNAME/orgs/octo-org/repos",
"events_url": "https://HOSTNAME/orgs/octo-org/events",
"hooks_url": "https://HOSTNAME/orgs/octo-org/hooks",
"issues_url": "https://HOSTNAME/orgs/octo-org/issues",
"members_url": "https://HOSTNAME/orgs/octo-org/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/octo-org/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]
}
Set selected organizations enabled for GitHub Actions in an enterprise
Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Set selected organizations enabled for GitHub Actions in an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Set selected organizations enabled for GitHub Actions in an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nom, Type, Description |
---|
selected_organization_ids array of integers ObligatoireList of organization IDs to enable for GitHub Actions. |
Codes d’état de la réponse HTTP pour « Set selected organizations enabled for GitHub Actions in an enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set selected organizations enabled for GitHub Actions in an enterprise »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/organizations \
-d '{"selected_organization_ids":[32,91]}'
Response
Status: 204
Enable a selected organization for GitHub Actions in an enterprise
Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Enable a selected organization for GitHub Actions in an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Enable a selected organization for GitHub Actions in an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
org_id integer ObligatoireThe unique identifier of the organization. |
Codes d’état de la réponse HTTP pour « Enable a selected organization for GitHub Actions in an enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Enable a selected organization for GitHub Actions in an enterprise »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_ID
Response
Status: 204
Disable a selected organization for GitHub Actions in an enterprise
Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Disable a selected organization for GitHub Actions in an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Disable a selected organization for GitHub Actions in an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
org_id integer ObligatoireThe unique identifier of the organization. |
Codes d’état de la réponse HTTP pour « Disable a selected organization for GitHub Actions in an enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Disable a selected organization for GitHub Actions in an enterprise »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_ID
Response
Status: 204
Get allowed actions for an enterprise
Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Get allowed actions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Get allowed actions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Codes d’état de la réponse HTTP pour « Get allowed actions for an enterprise »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get allowed actions for an enterprise »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/selected-actions
Response
Status: 200
{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}
Set allowed actions for an enterprise
Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Set allowed actions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Set allowed actions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nom, Type, Description |
---|
github_owned_allowed boolean ObligatoireWhether GitHub-owned actions are allowed. For example, this includes the actions in the |
patterns_allowed array of strings ObligatoireSpecifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, |
Codes d’état de la réponse HTTP pour « Set allowed actions for an enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set allowed actions for an enterprise »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/selected-actions \
-d '{"github_owned_allowed":true,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'
Response
Status: 204
Get default workflow permissions for an enterprise
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an enterprise,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"Enforcing a policy for workflow permissions in your enterprise."
OAuth tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Get default workflow permissions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Get default workflow permissions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Codes d’état de la réponse HTTP pour « Get default workflow permissions for an enterprise »
Code d’état | Description |
---|---|
200 | Success response |
Exemples de code pour « Get default workflow permissions for an enterprise »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/workflow
Give read-only permission, and allow approving PRs.
Status: 200
{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}
Set default workflow permissions for an enterprise
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an enterprise, and sets
whether GitHub Actions can submit approving pull request reviews. For more information, see
"Enforcing a policy for workflow permissions in your enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise
scope to use this endpoint.
Jetons d’accès affinés pour « Set default workflow permissions for an enterprise »
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour « Set default workflow permissions for an enterprise »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Nom, Type, Description |
---|
default_workflow_permissions string The default workflow permissions granted to the GITHUB_TOKEN when running workflows. Peut être: |
can_approve_pull_request_reviews boolean Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. |
Codes d’état de la réponse HTTP pour « Set default workflow permissions for an enterprise »
Code d’état | Description |
---|---|
204 | Success response |
Exemples de code pour « Set default workflow permissions for an enterprise »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/workflow \
-d '{"default_workflow_permissions":"read","can_approve_pull_request_reviews":true}'
Success response
Status: 204
Get GitHub Actions permissions for an organization
Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Jetons d’accès affinés pour « Get GitHub Actions permissions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (read)
Paramètres pour « Get GitHub Actions permissions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get GitHub Actions permissions for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get GitHub Actions permissions for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions
Response
Status: 200
{
"enabled_repositories": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://HOSTNAME/organizations/42/actions/permissions/selected-actions"
}
Set GitHub Actions permissions for an organization
Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.
If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions
to selected
actions, then you cannot override them for the organization.
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Set GitHub Actions permissions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour « Set GitHub Actions permissions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
enabled_repositories string ObligatoireThe policy that controls the repositories in the organization that are allowed to run GitHub Actions. Peut être: |
allowed_actions string The permissions policy that controls the actions that are allowed to run. Peut être: |
Codes d’état de la réponse HTTP pour « Set GitHub Actions permissions for an organization »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set GitHub Actions permissions for an organization »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions \
-d '{"enabled_repositories":"all","allowed_actions":"selected"}'
Response
Status: 204
List selected repositories enabled for GitHub Actions in an organization
Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization."
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « List selected repositories enabled for GitHub Actions in an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (read)
Paramètres pour « List selected repositories enabled for GitHub Actions in an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
Codes d’état de la réponse HTTP pour « List selected repositories enabled for GitHub Actions in an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « List selected repositories enabled for GitHub Actions in an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/repositories
Response
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://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/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://HOSTNAME/repos/octocat/Hello-World",
"archive_url": "https://HOSTNAME/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://HOSTNAME/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://HOSTNAME/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://HOSTNAME/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://HOSTNAME/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://HOSTNAME/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://HOSTNAME/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://HOSTNAME/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://HOSTNAME/repos/octocat/Hello-World/contributors",
"deployments_url": "https://HOSTNAME/repos/octocat/Hello-World/deployments",
"downloads_url": "https://HOSTNAME/repos/octocat/Hello-World/downloads",
"events_url": "https://HOSTNAME/repos/octocat/Hello-World/events",
"forks_url": "https://HOSTNAME/repos/octocat/Hello-World/forks",
"git_commits_url": "https://HOSTNAME/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://HOSTNAME/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://HOSTNAME/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://HOSTNAME/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://HOSTNAME/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://HOSTNAME/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://HOSTNAME/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://HOSTNAME/repos/octocat/Hello-World/languages",
"merges_url": "https://HOSTNAME/repos/octocat/Hello-World/merges",
"milestones_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://HOSTNAME/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://HOSTNAME/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://HOSTNAME/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://HOSTNAME/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://HOSTNAME/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://HOSTNAME/repos/octocat/Hello-World/subscription",
"tags_url": "https://HOSTNAME/repos/octocat/Hello-World/tags",
"teams_url": "https://HOSTNAME/repos/octocat/Hello-World/teams",
"trees_url": "https://HOSTNAME/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://HOSTNAME/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://HOSTNAME/licenses/mit",
"spdx_id": "MIT",
"node_id": "MDc6TGljZW5zZW1pdA==",
"html_url": "https://github.com/licenses/mit"
},
"forks": 1,
"open_issues": 1,
"watchers": 1
}
]
}
Set selected repositories enabled for GitHub Actions in an organization
Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization."
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Set selected repositories enabled for GitHub Actions in an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour « Set selected repositories enabled for GitHub Actions in an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
selected_repository_ids array of integers ObligatoireList of repository IDs to enable for GitHub Actions. |
Codes d’état de la réponse HTTP pour « Set selected repositories enabled for GitHub Actions in an organization »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set selected repositories enabled for GitHub Actions in an organization »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/repositories \
-d '{"selected_repository_ids":[32,42]}'
Response
Status: 204
Enable a selected repository for GitHub Actions in an organization
Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization."
OAuth tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Enable a selected repository for GitHub Actions in an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write) and "Metadata" repository permissions (read)
Paramètres pour « Enable a selected repository for GitHub Actions in an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
repository_id integer ObligatoireThe unique identifier of the repository. |
Codes d’état de la réponse HTTP pour « Enable a selected repository for GitHub Actions in an organization »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Enable a selected repository for GitHub Actions in an organization »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID
Response
Status: 204
Disable a selected repository for GitHub Actions in an organization
Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization."
OAuth tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Disable a selected repository for GitHub Actions in an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write) and "Metadata" repository permissions (read)
Paramètres pour « Disable a selected repository for GitHub Actions in an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
repository_id integer ObligatoireThe unique identifier of the repository. |
Codes d’état de la réponse HTTP pour « Disable a selected repository for GitHub Actions in an organization »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Disable a selected repository for GitHub Actions in an organization »
Exemple de requête
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID
Response
Status: 204
Get allowed actions for an organization
Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization.""
You must authenticate using an access token with the admin:org
scope to use this endpoint. GitHub Apps must have the administration
organization permission to use this API.
Jetons d’accès affinés pour « Get allowed actions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (read)
Paramètres pour « Get allowed actions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get allowed actions for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get allowed actions for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/selected-actions
Response
Status: 200
{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}
Set allowed actions for an organization
Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for an organization."
If the organization belongs to an enterprise that has selected
actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.
To use the patterns_allowed
setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed
setting only applies to public repositories in the organization.
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Set allowed actions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour « Set allowed actions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
github_owned_allowed boolean ObligatoireWhether GitHub-owned actions are allowed. For example, this includes the actions in the |
patterns_allowed array of strings ObligatoireSpecifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, |
Codes d’état de la réponse HTTP pour « Set allowed actions for an organization »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set allowed actions for an organization »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/selected-actions \
-d '{"github_owned_allowed":true,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'
Response
Status: 204
Get default workflow permissions for an organization
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."
OAuth tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Get default workflow permissions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (read)
Paramètres pour « Get default workflow permissions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Codes d’état de la réponse HTTP pour « Get default workflow permissions for an organization »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get default workflow permissions for an organization »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/workflow
Give read-only permission, and allow approving PRs.
Status: 200
{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}
Set default workflow permissions for an organization
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
Jetons d’accès affinés pour « Set default workflow permissions for an organization »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" organization permissions (write)
Paramètres pour « Set default workflow permissions for an organization »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
org string ObligatoireThe organization name. The name is not case sensitive. |
Nom, Type, Description |
---|
default_workflow_permissions string The default workflow permissions granted to the GITHUB_TOKEN when running workflows. Peut être: |
can_approve_pull_request_reviews boolean Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. |
Codes d’état de la réponse HTTP pour « Set default workflow permissions for an organization »
Code d’état | Description |
---|---|
204 | Success response |
409 | Conflict response when changing a setting is prevented by the owning enterprise |
Exemples de code pour « Set default workflow permissions for an organization »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/actions/permissions/workflow \
-d '{"default_workflow_permissions":"read","can_approve_pull_request_reviews":true}'
Success response
Status: 204
Get GitHub Actions permissions for a repository
Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
Jetons d’accès affinés pour « Get GitHub Actions permissions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (read)
Paramètres pour « Get GitHub Actions permissions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Codes d’état de la réponse HTTP pour « Get GitHub Actions permissions for a repository »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get GitHub Actions permissions for a repository »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions
Response
Status: 200
{
"enabled": true,
"allowed_actions": "selected",
"selected_actions_url": "https://HOSTNAME/repositories/42/actions/permissions/selected-actions"
}
Set GitHub Actions permissions for a repository
Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.
If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as allowed_actions
to selected
actions, then you cannot override them for the repository.
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Set GitHub Actions permissions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (write)
Paramètres pour « Set GitHub Actions permissions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Nom, Type, Description |
---|
enabled boolean ObligatoireWhether GitHub Actions is enabled on the repository. |
allowed_actions string The permissions policy that controls the actions that are allowed to run. Peut être: |
Codes d’état de la réponse HTTP pour « Set GitHub Actions permissions for a repository »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set GitHub Actions permissions for a repository »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions \
-d '{"enabled":true,"allowed_actions":"selected"}'
Response
Status: 204
Get the level of access for workflows outside of the repository
Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal and private repositories. For more information, see "Allowing access to components in a private repository" and "Allowing access to components in an internal repository."
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Get the level of access for workflows outside of the repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (read)
Paramètres pour « Get the level of access for workflows outside of the repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Codes d’état de la réponse HTTP pour « Get the level of access for workflows outside of the repository »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get the level of access for workflows outside of the repository »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/access
Response
Status: 200
{
"access_level": "organization"
}
Set the level of access for workflows outside of the repository
Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal and private repositories. For more information, see "Allowing access to components in a private repository" and "Allowing access to components in an internal repository."
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Set the level of access for workflows outside of the repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (write)
Paramètres pour « Set the level of access for workflows outside of the repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Nom, Type, Description |
---|
access_level string ObligatoireDefines the level of access that workflows outside of the repository have to actions and reusable workflows within the repository.
Peut être: |
Codes d’état de la réponse HTTP pour « Set the level of access for workflows outside of the repository »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set the level of access for workflows outside of the repository »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/access \
-d '{"access_level":"organization"}'
Response
Status: 204
Get allowed actions for a repository
Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for a repository."
You must authenticate using an access token with the repo
scope to use this endpoint. GitHub Apps must have the administration
repository permission to use this API.
Jetons d’accès affinés pour « Get allowed actions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (read)
Paramètres pour « Get allowed actions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Codes d’état de la réponse HTTP pour « Get allowed actions for a repository »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get allowed actions for a repository »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/selected-actions
Response
Status: 200
{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}
Set allowed actions for a repository
Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions
must be configured to selected
. For more information, see "Set GitHub Actions permissions for a repository."
If the repository belongs to an organization or enterprise that has selected
actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.
To use the patterns_allowed
setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the patterns_allowed
setting only applies to public repositories.
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Set allowed actions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (write)
Paramètres pour « Set allowed actions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Nom, Type, Description |
---|
github_owned_allowed boolean ObligatoireWhether GitHub-owned actions are allowed. For example, this includes the actions in the |
patterns_allowed array of strings ObligatoireSpecifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, |
Codes d’état de la réponse HTTP pour « Set allowed actions for a repository »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Set allowed actions for a repository »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/selected-actions \
-d '{"github_owned_allowed":true,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'
Response
Status: 204
Get default workflow permissions for a repository
Gets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."
OAuth tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Get default workflow permissions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (read)
Paramètres pour « Get default workflow permissions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Codes d’état de la réponse HTTP pour « Get default workflow permissions for a repository »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get default workflow permissions for a repository »
Exemple de requête
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/workflow
Give read-only permission, and allow approving PRs.
Status: 200
{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}
Set default workflow permissions for a repository
Sets the default workflow permissions granted to the GITHUB_TOKEN
when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."
OAuth app tokens and personal access tokens (classic) need the repo
scope to use this endpoint.
Jetons d’accès affinés pour « Set default workflow permissions for a repository »
Ce point de terminaison fonctionne avec les types de jetons précis suivants:
- Jetons d’accès utilisateur d’application GitHub
- Jetons d’accès d’installation d’application GitHub
- Jetons d’accès personnel affiné
Le jeton précis doit avoir l’ensemble d’autorisations suivant:
- "Administration" repository permissions (write)
Paramètres pour « Set default workflow permissions for a repository »
Nom, Type, Description |
---|
accept string Setting to |
Nom, Type, Description |
---|
owner string ObligatoireThe account owner of the repository. The name is not case sensitive. |
repo string ObligatoireThe name of the repository without the |
Nom, Type, Description |
---|
default_workflow_permissions string The default workflow permissions granted to the GITHUB_TOKEN when running workflows. Peut être: |
can_approve_pull_request_reviews boolean Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. |
Codes d’état de la réponse HTTP pour « Set default workflow permissions for a repository »
Code d’état | Description |
---|---|
204 | Success response |
409 | Conflict response when changing a setting is prevented by the owning organization or enterprise |
Exemples de code pour « Set default workflow permissions for a repository »
Exemple de requête
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/permissions/workflow \
-d '{"default_workflow_permissions":"read","can_approve_pull_request_reviews":true}'
Success response
Status: 204