GET/repos/{owner}/{repo}/actions/policies/{policy_id}

Get a repository Actions policy

Retrieves a specific Actions policy for a repository. Use policy_id to identify the policy and inspect its target, source, enforcement level, and rules.

3 parameters
ownerstringrequired
The account owner of the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.
policy_idintegerrequired
The ID of the policy to retrieve.

3 status codes
200Returns the Actions policy object, including its target, source, enforcement level, rules, and timestamps.
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
404Returned when the repository or policy cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
500Returned when an internal server error occurs.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned when the repository or policy cannot be found. A 500 indicates an internal server error; the policy_id path parameter must identify the policy to retrieve.