PUT/orgs/{org}/actions/policies/{policy_id}

Update an organization Actions policy

Update an Actions policy for an organization. Omitting workflow_path preserves the policy's existing workflow targeting.

2 parameters · 4 body fields
orgstringrequired
The organization name. The name is not case sensitive.
policy_idintegerrequired
The ID of the policy.
namestringoptional
The name of the policy.
enforcementstringoptional
The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise).
Allowed:disabledactiveevaluate
conditionsobjectoptional
Conditions for an organization Actions policy. The conditions object should contain one of `repository_name`, `repository_id`, or `repository_property`, and may also contain `workflow_path`.
rulesarray<ActionsRule>optional
An array of rules within the policy.

4 status codes
200Response
idintegerrequired
The ID of the policy
namestringrequired
The name of the policy
targetstringrequired
The target of the policy
Allowed:actions
source_typestringrequired
The type of the source of the policy
Allowed:RepositoryOrganizationEnterprise
sourcestringrequired
The name of the source
enforcementstringrequired
The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise).
Allowed:disabledactiveevaluate
conditionsobjectoptional
When workflow path targeting is available, detailed responses represent an omitted stored workflow condition as `workflow_path` with `include` set to `["~ALL"]` and `exclude` set to `[]`. When workflow path targeting is unavailable, an omitted stored condition remains omitted.
rulesarray<ActionsRule>optional
An array of rules within the policy
node_idstringoptional
_linksobjectoptional
created_atstringoptional
updated_atstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
500Internal Error
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed. A 500 is returned: Internal Error.