GitHub Actions Permissions
The GitHub Actions Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run GitHub Actions, and what actions and reusable workflows are allowed to run.
About the Permissions API
The GitHub Actions Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run GitHub Actions, and what actions and reusable workflows are allowed to run. For more information, see "Usage limits, billing, and administration."
Get GitHub Actions permissions for an enterprise
Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
Parameters
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
enterprisestringRequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK |
Code samples
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissionsResponse
Status: 200{
"enabled_organizations": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://api.github.com/enterprises/2/actions/permissions/selected-actions"
}Set GitHub Actions permissions for an enterprise
Sets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
Parameters
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
enterprisestringRequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
| Body parameters |
| Name, Type, Description |
enabled_organizationsstringRequiredThe policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: |
allowed_actionsstringThe permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: |
HTTP response status codes
| Status code | Description |
|---|---|
204 | No Content |
Code samples
curl \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions \
-d '{"enabled_organizations":"all","allowed_actions":"selected"}'Response
Status: 204List 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."
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
Parameters
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
enterprisestringRequiredThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
| Query parameters |
| Name, Type, Description |
per_pageintegerThe number of results per page (max 100). Default: |
pageintegerPage number of the results to fetch. Default: |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK |
Code samples
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizationsResponse
Status: 200{
"total_count": 1,
"organizations": [
{
"login": "octocat",
"id": 161335,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2