Use the REST API to interact with permissions for GitHub Actions.
You can use the REST API to set permissions for the organizations and repositories that are allowed to run GitHub Actions, and the actions and reusable workflows that are allowed to run. For more information, see Disabling or limiting GitHub Actions for your organization, and Managing GitHub Actions settings for a repository.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /orgs/{org}/actions/permissions
Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions
Response schema (Status: 200):
enabled_repositories: required, string, enum: all, none, selectedselected_repositories_url: stringallowed_actions: string, enum: all, local_only, selectedselected_actions_url: stringsha_pinning_required: booleanPUT /orgs/{org}/actions/permissions
Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)enabled_repositories (string) (required)
The policy that controls the repositories in the organization that are allowed to run GitHub Actions.
Can be one of: all, none, selected
allowed_actions (string)
The permissions policy that controls the actions and reusable workflows that are allowed to run.
Can be one of: all, local_only, selected
sha_pinning_required (boolean)
Whether actions must be pinned to a full-length commit SHA.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions \
-d '{
"enabled_repositories": "all",
"allowed_actions": "selected",
"sha_pinning_required": true
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/artifact-and-log-retention
Gets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for an organization.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/artifact-and-log-retention
Response schema (Status: 200):
days: required, integermaximum_allowed_days: required, integerPUT /orgs/{org}/actions/permissions/artifact-and-log-retention
Sets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for an organization.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)days (integer) (required)204 - No content
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/artifact-and-log-retention \
-d '{
"days": 100
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval
Gets the fork PR contributor approval policy for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/fork-pr-contributor-approval
Response schema (Status: 200):
approval_policy: required, string, enum: first_time_contributors_new_to_github, first_time_contributors, all_external_contributorsPUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval
Sets the fork PR contributor approval policy for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)approval_policy (string) (required)first_time_contributors_new_to_github, first_time_contributors, all_external_contributors204 - No Content
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/fork-pr-contributor-approval \
-d '{
"approval_policy": "first_time_contributors"
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos
Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/fork-pr-workflows-private-repos
Response schema (Status: 200):
run_workflows_from_fork_pull_requests: required, booleansend_write_tokens_to_workflows: required, booleansend_secrets_and_variables: required, booleanrequire_approval_for_fork_pr_workflows: required, booleanPUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos
Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization.
accept (string)application/vnd.github+json is recommended.org (string) (required)run_workflows_from_fork_pull_requests (boolean) (required)
Whether workflows triggered by pull requests from forks are allowed to run on private repositories.
send_write_tokens_to_workflows (boolean)
Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request.
send_secrets_and_variables (boolean)
Whether to make secrets and variables available to workflows triggered by pull requests from forks.
require_approval_for_fork_pr_workflows (boolean)
Whether workflows triggered by pull requests from forks require approval from a repository administrator to run.
204 - Empty response for successful settings update
403 - Forbidden - Fork PR workflow settings for private repositories are managed by the enterprise owner
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/fork-pr-workflows-private-repos \
-d '{
"run_workflows_from_fork_pull_requests": true,
"send_write_tokens_to_workflows": false,
"send_secrets_and_variables": false,
"require_approval_for_fork_pr_workflows": true
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/repositories
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/repositories
Response schema (Status: 200):
total_count: required, numberrepositories: required, array of Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringlicense: required, any of:
key: required, stringname: required, stringurl: required, string or null, format: urispdx_id: required, string or nullnode_id: required, stringhtml_url: string, format: uriforks: required, integerpermissions: object:
admin: required, booleanpull: required, booleantriage: booleanpush: required, booleanmaintain: booleanowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, boolean, default: falsehtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: required, stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: required, stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: required, stringmirror_url: required, string or null, format: urihooks_url: required, string, format: urisvn_url: required, string, format: urihomepage: required, string or null, format: urilanguage: required, string or nullforks_count: required, integerstargazers_count: required, integerwatchers_count: required, integersize: required, integerdefault_branch: required, stringopen_issues_count: required, integeris_template: boolean, default: falsetopics: array of stringhas_issues: required, boolean, default: truehas_projects: required, boolean, default: truehas_wiki: required, boolean, default: truehas_pages: required, booleanhas_discussions: boolean, default: falsehas_pull_requests: boolean, default: truepull_request_creation_policy: string, enum: all, collaborators_onlyarchived: required, boolean, default: falsedisabled: required, booleanvisibility: string, default: "public"pushed_at: required, string or null, format: date-timecreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeallow_rebase_merge: boolean, default: truetemp_clone_token: stringallow_squash_merge: boolean, default: trueallow_auto_merge: boolean, default: falsedelete_branch_on_merge: boolean, default: falseallow_update_branch: boolean, default: falsesquash_merge_commit_title: string, enum: PR_TITLE, COMMIT_OR_PR_TITLEsquash_merge_commit_message: string, enum: PR_BODY, COMMIT_MESSAGES, BLANKmerge_commit_title: string, enum: PR_TITLE, MERGE_MESSAGEmerge_commit_message: string, enum: PR_BODY, PR_TITLE, BLANKallow_merge_commit: boolean, default: trueallow_forking: booleanweb_commit_signoff_required: boolean, default: falseopen_issues: required, integerwatchers: required, integerstarred_at: stringanonymous_access_enabled: booleancode_search_index_status: object:
lexical_search_ok: booleanlexical_commit_sha: stringPUT /orgs/{org}/actions/permissions/repositories
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)selected_repository_ids (array of integers) (required)Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/repositories \
-d '{
"selected_repository_ids": [
32,
42
]
}'
Response schema (Status: 204):
PUT /orgs/{org}/actions/permissions/repositories/{repository_id}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID
Response schema (Status: 204):
DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/selected-actions
Gets the selected actions and reusable workflows 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."
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/selected-actions
Response schema (Status: 200):
github_owned_allowed: booleanverified_allowed: booleanpatterns_allowed: array of stringPUT /orgs/{org}/actions/permissions/selected-actions
Sets the actions and reusable workflows 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."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)github_owned_allowed (boolean)
Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.
verified_allowed (boolean)
Whether actions from GitHub Marketplace verified creators are allowed. Set to true to allow all actions by GitHub Marketplace verified creators.
patterns_allowed (array of strings)
Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@, monalisa/octocat@v2, monalisa/.
Note
The patterns_allowed setting only applies to public repositories.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/selected-actions \
-d '{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/self-hosted-runners
Gets the settings for self-hosted runners for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners
Response schema (Status: 200):
enabled_repositories: required, string, enum: all, selected, noneselected_repositories_url: stringPUT /orgs/{org}/actions/permissions/self-hosted-runners
Sets the settings for self-hosted runners for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)enabled_repositories (string) (required)all, selected, none204 - No content
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners \
-d '{
"enabled_repositories": "all"
}'
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories
Lists repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories
Response schema (Status: 200):
total_count: integerrepositories: array of Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringlicense: required, any of:
key: required, stringname: required, stringurl: required, string or null, format: urispdx_id: required, string or nullnode_id: required, stringhtml_url: string, format: uriforks: required, integerpermissions: object:
admin: required, booleanpull: required, booleantriage: booleanpush: required, booleanmaintain: booleanowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, boolean, default: falsehtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: required, stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: required, stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: required, stringmirror_url: required, string or null, format: urihooks_url: required, string, format: urisvn_url: required, string, format: urihomepage: required, string or null, format: urilanguage: required, string or nullforks_count: required, integerstargazers_count: required, integerwatchers_count: required, integersize: required, integerdefault_branch: required, stringopen_issues_count: required, integeris_template: boolean, default: falsetopics: array of stringhas_issues: required, boolean, default: truehas_projects: required, boolean, default: truehas_wiki: required, boolean, default: truehas_pages: required, booleanhas_discussions: boolean, default: falsehas_pull_requests: boolean, default: truepull_request_creation_policy: string, enum: all, collaborators_onlyarchived: required, boolean, default: falsedisabled: required, booleanvisibility: string, default: "public"pushed_at: required, string or null, format: date-timecreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeallow_rebase_merge: boolean, default: truetemp_clone_token: stringallow_squash_merge: boolean, default: trueallow_auto_merge: boolean, default: falsedelete_branch_on_merge: boolean, default: falseallow_update_branch: boolean, default: falsesquash_merge_commit_title: string, enum: PR_TITLE, COMMIT_OR_PR_TITLEsquash_merge_commit_message: string, enum: PR_BODY, COMMIT_MESSAGES, BLANKmerge_commit_title: string, enum: PR_TITLE, MERGE_MESSAGEmerge_commit_message: string, enum: PR_BODY, PR_TITLE, BLANKallow_merge_commit: boolean, default: trueallow_forking: booleanweb_commit_signoff_required: boolean, default: falseopen_issues: required, integerwatchers: required, integerstarred_at: stringanonymous_access_enabled: booleancode_search_index_status: object:
lexical_search_ok: booleanlexical_commit_sha: stringPUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories
Sets repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)selected_repository_ids (array of integers) (required)204 - No content
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories \
-d '{
"selected_repository_ids": [
1,
2,
3
]
}'
Response schema (Status: 204):
PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}
Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
204 - No content
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories/REPOSITORY_ID
Response schema (Status: 204):
DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}
Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
repository_id (integer) (required)
The unique identifier of the repository.
204 - No content
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories/REPOSITORY_ID
Response schema (Status: 204):
GET /orgs/{org}/actions/permissions/workflow
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/actions/permissions/workflow
Response schema (Status: 200):
default_workflow_permissions: required, string, enum: read, writecan_approve_pull_request_reviews: required, booleanPUT /orgs/{org}/actions/permissions/workflow
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)default_workflow_permissions (string)
The default workflow permissions granted to the GITHUB_TOKEN when running workflows.
Can be one of: read, write
can_approve_pull_request_reviews (boolean)
Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/actions/permissions/workflow \
-d '{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions
Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions
Response schema (Status: 200):
enabled: required, booleanallowed_actions: string, enum: all, local_only, selectedselected_actions_url: stringsha_pinning_required: booleanPUT /repos/{owner}/{repo}/actions/permissions
Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
enabled (boolean) (required)
Whether GitHub Actions is enabled on the repository.
allowed_actions (string)
The permissions policy that controls the actions and reusable workflows that are allowed to run.
Can be one of: all, local_only, selected
sha_pinning_required (boolean)
Whether actions must be pinned to a full-length commit SHA.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions \
-d '{
"enabled": true,
"allowed_actions": "selected",
"sha_pinning_required": true
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/access
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 private repositories.
For more information, see "Allowing access to components in a private repository."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/access
Response schema (Status: 200):
access_level: required, string, enum: none, user, organizationPUT /repos/{owner}/{repo}/actions/permissions/access
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 private repositories.
For more information, see "Allowing access to components in a private repository".
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
access_level (string) (required)none, user, organizationRequest:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/access \
-d '{
"access_level": "organization"
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention
Gets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for a repository.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/artifact-and-log-retention
Response schema (Status: 200):
Same response schema as Get artifact and log retention settings for an organization.
PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention
Sets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for a repository.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
days (integer) (required)204 - Empty response for successful settings update
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/artifact-and-log-retention \
-d '{
"days": 90
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval
Gets the fork PR contributor approval policy for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval
Response schema (Status: 200):
Same response schema as Get fork PR contributor approval permissions for an organization.
PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval
Sets the fork PR contributor approval policy for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
approval_policy (string) (required)first_time_contributors_new_to_github, first_time_contributors, all_external_contributors204 - No Content
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval \
-d '{
"approval_policy": "first_time_contributors"
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos
Gets the settings for whether workflows from fork pull requests can run on a private repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-workflows-private-repos
Response schema (Status: 200):
Same response schema as Get private repo fork PR workflow settings for an organization.
PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos
Sets the settings for whether workflows from fork pull requests can run on a private repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
run_workflows_from_fork_pull_requests (boolean) (required)
Whether workflows triggered by pull requests from forks are allowed to run on private repositories.
send_write_tokens_to_workflows (boolean)
Whether GitHub Actions can create pull requests or submit approving pull request reviews from a workflow triggered by a fork pull request.
send_secrets_and_variables (boolean)
Whether to make secrets and variables available to workflows triggered by pull requests from forks.
require_approval_for_fork_pr_workflows (boolean)
Whether workflows triggered by pull requests from forks require approval from a repository administrator to run.
204 - Empty response for successful settings update
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-workflows-private-repos \
-d '{
"run_workflows_from_fork_pull_requests": true,
"send_write_tokens_to_workflows": false,
"send_secrets_and_variables": false,
"require_approval_for_fork_pr_workflows": true
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/selected-actions
Gets the settings for selected actions and reusable workflows 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."
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actions
Response schema (Status: 200):
Same response schema as Get allowed actions and reusable workflows for an organization.
PUT /repos/{owner}/{repo}/actions/permissions/selected-actions
Sets the actions and reusable workflows 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."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
github_owned_allowed (boolean)
Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.
verified_allowed (boolean)
Whether actions from GitHub Marketplace verified creators are allowed. Set to true to allow all actions by GitHub Marketplace verified creators.
patterns_allowed (array of strings)
Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@, monalisa/octocat@v2, monalisa/.
Note
The patterns_allowed setting only applies to public repositories.
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actions \
-d '{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}'
Response schema (Status: 204):
GET /repos/{owner}/{repo}/actions/permissions/workflow
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.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/actions/permissions/workflow
Response schema (Status: 200):
Same response schema as Get default workflow permissions for an organization.
PUT /repos/{owner}/{repo}/actions/permissions/workflow
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.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
default_workflow_permissions (string)
The default workflow permissions granted to the GITHUB_TOKEN when running workflows.
Can be one of: read, write
can_approve_pull_request_reviews (boolean)
Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.
204 - Success response
409 - Conflict response when changing a setting is prevented by the owning organization
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/actions/permissions/workflow \
-d '{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}'
Response schema (Status: 204):