REST API endpoints for GitHub Actions policies
Use the REST API to view and manage policies for GitHub Actions.
List enterprise Actions policies
List all Actions policies for an enterprise.
"List enterprise Actions policies"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"List enterprise Actions policies"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
enterprise string 필수The slug version of the enterprise name. |
| 이름, 유형, 설명 |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
"List enterprise Actions policies"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"List enterprise Actions policies"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/actions/policiesResponse
Status: 200{
"total_count": 2,
"policies": [
{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"node_id": "RUL_lA",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/1"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/1"
}
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Restrict workflow events",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "evaluate",
"node_id": "RUL_lB",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/2"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/2"
}
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]
}Create an enterprise Actions policy
Create an Actions policy for an enterprise.
Omitting workflow_path targets all workflows without storing an explicit condition.
"Create an enterprise Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Create an enterprise Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
enterprise string 필수The slug version of the enterprise name. |
| 이름, 유형, 설명 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string 필수The name of the policy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enforcement string 필수The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
conditions object Conditions for an enterprise Actions policy. The conditions object supports one organization
target ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can be one of these objects:
repository_name object 필수Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_name_and_repository_property object Conditions to target organizations by name and repositories by property
Properties of organization_name_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_name object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings Array of organization names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of organization names or patterns to exclude. The condition will not pass if any of these patterns match. |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_id_and_repository_name object Conditions to target organizations by id and repositories by name
Properties of organization_id_and_repository_name
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
organization_id object 필수 | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
organization_ids array of integers The organization IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
repository_name object 필수Properties of repository_name
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_id_and_repository_property object Conditions to target organizations by id and repositories by property
Properties of organization_id_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_id object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 |
|---|
organization_ids array of integers The organization IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_property_and_repository_name object Conditions to target organizations by property and repositories by name
Properties of organization_property_and_repository_name
| 이름, 유형, 설명 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
organization_property object 필수 | |||||||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
include array of objects The organization properties and values to include. All of these properties must match for the condition to pass. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
exclude array of objects The organization properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
repository_name object 필수Properties of repository_name
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_property_and_repository_property object Conditions to target organizations by property and repositories by property
Properties of organization_property_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_property object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
include array of objects The organization properties and values to include. All of these properties must match for the condition to pass. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
exclude array of objects The organization properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
rules array of objects An array of rules within the policy.
Can be one of these objects:
| 이름, 유형, 설명 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
restrict_actions_actors object Choose specific actors that are authorized to trigger Actions workflows. | ||||||||||
Properties of |
| 이름, 유형, 설명 | ||||||
|---|---|---|---|---|---|---|
type string 필수값: | ||||||
parameters object | ||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
allowed_actors array of objects 필수Select the actors who can run Actions workflows. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
id integer 필수ID of the actor authorized to trigger Actions workflows. |
type string 필수The type of the actor 다음 중 하나일 수 있습니다.: |
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows.
Properties of restrict_action_events
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Create an enterprise Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
201 | Created |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Create an enterprise Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/actions/policies \
-d '{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}'Response
Status: 201{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Get an enterprise Actions policy
Get a specific Actions policy for an enterprise.
"Get an enterprise Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Get an enterprise Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
enterprise string 필수The slug version of the enterprise name. |
policy_id integer 필수The ID of the policy. |
"Get an enterprise Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"Get an enterprise Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/actions/policies/POLICY_IDResponse
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Update an enterprise Actions policy
Update an Actions policy for an enterprise.
Omitting workflow_path preserves the policy's existing workflow targeting.
"Update an enterprise Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Update an enterprise Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
enterprise string 필수The slug version of the enterprise name. |
policy_id integer 필수The ID of the policy. |
| 이름, 유형, 설명 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string The name of the policy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enforcement string The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
conditions object Conditions for an enterprise Actions policy. The conditions object supports one organization
target ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can be one of these objects:
repository_name object 필수Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_name_and_repository_property object Conditions to target organizations by name and repositories by property
Properties of organization_name_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_name object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings Array of organization names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of organization names or patterns to exclude. The condition will not pass if any of these patterns match. |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_id_and_repository_name object Conditions to target organizations by id and repositories by name
Properties of organization_id_and_repository_name
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
organization_id object 필수 | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
organization_ids array of integers The organization IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
repository_name object 필수Properties of repository_name
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_id_and_repository_property object Conditions to target organizations by id and repositories by property
Properties of organization_id_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_id object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 |
|---|
organization_ids array of integers The organization IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_property_and_repository_name object Conditions to target organizations by property and repositories by name
Properties of organization_property_and_repository_name
| 이름, 유형, 설명 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
organization_property object 필수 | |||||||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
include array of objects The organization properties and values to include. All of these properties must match for the condition to pass. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
exclude array of objects The organization properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
repository_name object 필수Properties of repository_name
| 이름, 유형, 설명 |
|---|
include array of strings Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts |
exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. |
protected boolean Whether renaming of target repositories is prevented. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
organization_property_and_repository_property object Conditions to target organizations by property and repositories by property
Properties of organization_property_and_repository_property
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
organization_property object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
include array of objects The organization properties and values to include. All of these properties must match for the condition to pass. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
exclude array of objects The organization properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the organization property to target |
property_values array of strings 필수The values to match for the organization property |
repository_property object 필수Properties of repository_property
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
rules array of objects An array of rules within the policy.
Can be one of these objects:
| 이름, 유형, 설명 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
restrict_actions_actors object Choose specific actors that are authorized to trigger Actions workflows. | ||||||||||
Properties of |
| 이름, 유형, 설명 | ||||||
|---|---|---|---|---|---|---|
type string 필수값: | ||||||
parameters object | ||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
allowed_actors array of objects 필수Select the actors who can run Actions workflows. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
id integer 필수ID of the actor authorized to trigger Actions workflows. |
type string 필수The type of the actor 다음 중 하나일 수 있습니다.: |
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows.
Properties of restrict_action_events
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Update an enterprise Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Update an enterprise Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/actions/policies/POLICY_ID \
-d '{"name":"Updated policy name","enforcement":"active"}'Response
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Delete an enterprise Actions policy
Delete an Actions policy for an enterprise.
"Delete an enterprise Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Delete an enterprise Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
enterprise string 필수The slug version of the enterprise name. |
policy_id integer 필수The ID of the policy. |
"Delete an enterprise Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | No Content |
404 | Resource not found |
500 | Internal Error |
"Delete an enterprise Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/actions/policies/POLICY_IDResponse
Status: 204List organization Actions policies
List all Actions policies for an organization.
"List organization Actions policies"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" organization permissions (write)
"List organization Actions policies"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
org string 필수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." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
has_parents boolean Include policies configured at higher levels that apply to this organization 기본값: |
"List organization Actions policies"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"List organization Actions policies"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/actions/policiesResponse
Status: 200{
"total_count": 2,
"policies": [
{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"node_id": "RUL_lA",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/1"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/1"
}
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Restrict workflow events",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "evaluate",
"node_id": "RUL_lB",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/2"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/2"
}
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]
}Create an organization Actions policy
Create an Actions policy for an organization.
Omitting workflow_path targets all workflows without storing an explicit condition.
"Create an organization Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" organization permissions (write)
"Create an organization Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
org string 필수The organization name. The name is not case sensitive. |
| 이름, 유형, 설명 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string 필수The name of the policy. | ||||||||||||||||||||||||||||||||||||||||||||||||||
enforcement string 필수The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | ||||||||||||||||||||||||||||||||||||||||||||||||||
conditions object Conditions for an organization Actions policy. The conditions object should contain one of
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Can be one of these objects:
workflow_path object Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
Repository ruleset conditions for repository IDs object Parameters for a repository ID condition
Properties of Repository ruleset conditions for repository IDs
| 이름, 유형, 설명 | |||
|---|---|---|---|
repository_id object 필수 | |||
Properties of |
| 이름, 유형, 설명 |
|---|
repository_ids array of integers The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
Repository ruleset conditions for repository properties object Parameters for a repository property condition
Properties of Repository ruleset conditions for repository properties
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
repository_property object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
rules array of objects An array of rules within the policy.
Can be one of these objects:
| 이름, 유형, 설명 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
restrict_actions_actors object Choose specific actors that are authorized to trigger Actions workflows. | ||||||||||
Properties of |
| 이름, 유형, 설명 | ||||||
|---|---|---|---|---|---|---|
type string 필수값: | ||||||
parameters object | ||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
allowed_actors array of objects 필수Select the actors who can run Actions workflows. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
id integer 필수ID of the actor authorized to trigger Actions workflows. |
type string 필수The type of the actor 다음 중 하나일 수 있습니다.: |
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows.
Properties of restrict_action_events
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Create an organization Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
201 | Created |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Create an organization Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/actions/policies \
-d '{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}'Response
Status: 201{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Get an organization Actions policy
Get a specific Actions policy for an organization.
"Get an organization Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" organization permissions (write)
"Get an organization Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
org string 필수The organization name. The name is not case sensitive. |
policy_id integer 필수The ID of the policy. |
"Get an organization Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"Get an organization Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/actions/policies/POLICY_IDResponse
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Update an organization Actions policy
Update an Actions policy for an organization.
Omitting workflow_path preserves the policy's existing workflow targeting.
"Update an organization Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" organization permissions (write)
"Update an organization Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
org string 필수The organization name. The name is not case sensitive. |
policy_id integer 필수The ID of the policy. |
| 이름, 유형, 설명 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string The name of the policy. | ||||||||||||||||||||||||||||||||||||||||||||||||||
enforcement string The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | ||||||||||||||||||||||||||||||||||||||||||||||||||
conditions object Conditions for an organization Actions policy. The conditions object should contain one of
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Can be one of these objects:
workflow_path object Properties of |
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
Repository ruleset conditions for repository IDs object Parameters for a repository ID condition
Properties of Repository ruleset conditions for repository IDs
| 이름, 유형, 설명 | |||
|---|---|---|---|
repository_id object 필수 | |||
Properties of |
| 이름, 유형, 설명 |
|---|
repository_ids array of integers The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass. |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
Repository ruleset conditions for repository properties object Parameters for a repository property condition
Properties of Repository ruleset conditions for repository properties
| 이름, 유형, 설명 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
repository_property object 필수 | |||||||||||||
Properties of |
| 이름, 유형, 설명 | ||||
|---|---|---|---|---|
include array of objects The repository properties and values to include. All of these properties must match for the condition to pass. | ||||
Properties of |
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
exclude array of objects The repository properties and values to exclude. The condition will not pass if any of these properties match.
Properties of exclude
| 이름, 유형, 설명 |
|---|
name string 필수The name of the repository property to target |
property_values array of strings 필수The values to match for the repository property |
source string The source of the repository property. Defaults to 'custom' if not specified. 다음 중 하나일 수 있습니다.: |
workflow_path object Properties of workflow_path
| 이름, 유형, 설명 |
|---|
include array of strings 필수Array of workflow file paths or glob patterns to include. An empty array includes all
workflows not matched by an excluded pattern. Use |
exclude array of strings 필수Array of workflow file paths or glob patterns to exclude. The condition will not pass
if any of these patterns match. |
rules array of objects An array of rules within the policy.
Can be one of these objects:
| 이름, 유형, 설명 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
restrict_actions_actors object Choose specific actors that are authorized to trigger Actions workflows. | ||||||||||
Properties of |
| 이름, 유형, 설명 | ||||||
|---|---|---|---|---|---|---|
type string 필수값: | ||||||
parameters object | ||||||
Properties of |
| 이름, 유형, 설명 | |||
|---|---|---|---|
allowed_actors array of objects 필수Select the actors who can run Actions workflows. | |||
Properties of |
| 이름, 유형, 설명 |
|---|
id integer 필수ID of the actor authorized to trigger Actions workflows. |
type string 필수The type of the actor 다음 중 하나일 수 있습니다.: |
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows.
Properties of restrict_action_events
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Update an organization Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Update an organization Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/actions/policies/POLICY_ID \
-d '{"name":"Updated policy name","enforcement":"active"}'Response
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Delete an organization Actions policy
Delete an Actions policy for an organization.
"Delete an organization Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" organization permissions (write)
"Delete an organization Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
org string 필수The organization name. The name is not case sensitive. |
policy_id integer 필수The ID of the policy. |
"Delete an organization Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | No Content |
404 | Resource not found |
500 | Internal Error |
"Delete an organization Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/orgs/ORG/actions/policies/POLICY_IDResponse
Status: 204List repository Actions policies
List all Actions policies for a repository.
"List repository Actions policies"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" repository permissions (write)
"List repository Actions policies"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
| 이름, 유형, 설명 |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
has_parents boolean Include policies configured at higher levels that apply to this repository 기본값: |
"List repository Actions policies"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"List repository Actions policies"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/actions/policiesResponse
Status: 200{
"total_count": 2,
"policies": [
{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"node_id": "RUL_lA",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/1"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/1"
}
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Restrict workflow events",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "evaluate",
"node_id": "RUL_lB",
"_links": {
"self": {
"href": "https://api.github.com/enterprises/enterprise/actions/policies/2"
},
"html": {
"href": "https://github.com/enterprises/enterprise/settings/policies/actions/2"
}
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]
}Create a repository Actions policy
Create an Actions policy for a repository.
Omitting workflow_path targets all workflows without storing an explicit condition.
"Create a repository Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" repository permissions (write)
"Create a repository Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
| 이름, 유형, 설명 | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string 필수The name of the policy. | |||||||||||||||||||||
enforcement string 필수The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | |||||||||||||||||||||
conditions object Conditions for a repository Actions policy. The object may be empty to preserve or use the
default workflow targeting, or contain only | |||||||||||||||||||||
Can be one of these objects:
| |||||||||||||||||||||
rules array of objects An array of rules within the policy. | |||||||||||||||||||||
Can be one of these objects:
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows. Properties of |
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Create a repository Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
201 | Created |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Create a repository Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/actions/policies \
-d '{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}'Response
Status: 201{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Get a repository Actions policy
Get a specific Actions policy for a repository.
"Get a repository Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" repository permissions (write)
"Get a repository Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
policy_id integer 필수The ID of the policy. |
"Get a repository Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
500 | Internal Error |
"Get a repository Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/actions/policies/POLICY_IDResponse
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Update a repository Actions policy
Update an Actions policy for a repository.
Omitting workflow_path preserves the policy's existing workflow targeting.
"Update a repository Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" repository permissions (write)
"Update a repository Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
policy_id integer 필수The ID of the policy. |
| 이름, 유형, 설명 | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name string The name of the policy. | |||||||||||||||||||||
enforcement string The enforcement level of the ruleset. 다음 중 하나일 수 있습니다.: | |||||||||||||||||||||
conditions object Conditions for a repository Actions policy. The object may be empty to preserve or use the
default workflow targeting, or contain only | |||||||||||||||||||||
Can be one of these objects:
| |||||||||||||||||||||
rules array of objects An array of rules within the policy. | |||||||||||||||||||||
Can be one of these objects:
restrict_action_events object Choose specific GitHub events that will trigger Actions workflows. Properties of |
| 이름, 유형, 설명 | ||
|---|---|---|
type string 필수값: | ||
parameters object | ||
Properties of |
| 이름, 유형, 설명 |
|---|
allowed_events array of strings 필수Select the events that can trigger Actions workflows.
Supported values are: |
"Update a repository Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
500 | Internal Error |
"Update a repository Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/actions/policies/POLICY_ID \
-d '{"name":"Updated policy name","enforcement":"active"}'Response
Status: 200{
"id": 1,
"name": "Restrict workflow modifications",
"target": "actions",
"source_type": "Enterprise",
"source": "enterprise",
"enforcement": "active",
"conditions": {
"organization_name": {
"include": [
"octo-org"
],
"exclude": []
},
"repository_name": {
"include": [
"octo-repo"
],
"exclude": []
}
},
"rules": [
{
"type": "restrict_actions_actors",
"parameters": {
"allowed_actors": [
{
"id": 5,
"type": "User"
},
{
"id": 1234,
"type": "Team"
}
]
}
}
],
"node_id": "RUL_lA",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Delete a repository Actions policy
Delete an Actions policy for a repository.
"Delete a repository Actions policy"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Administration" repository permissions (write)
"Delete a repository Actions policy"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
policy_id integer 필수The ID of the policy. |
"Delete a repository Actions policy"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | No Content |
404 | Resource not found |
500 | Internal Error |
"Delete a repository Actions policy"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/actions/policies/POLICY_IDResponse
Status: 204