{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Create an Actions policy for an organization.\nOmitting `workflow_path` targets all workflows without storing an explicit condition.","properties":{"path":{"type":"object","properties":{"org":{"type":"string","description":"The organization name. The name is not case sensitive."}},"required":["org"],"additionalProperties":false},"body":{"type":"object","properties":{"name":{"type":"string","description":"The name of the policy."},"enforcement":{"$ref":"#/definitions/repository-rule-enforcement"},"conditions":{"$ref":"#/definitions/actions-policy-org-conditions"},"rules":{"type":"array","description":"An array of rules within the policy.","items":{"$ref":"#/definitions/actions-rule"}}},"required":["name","enforcement"],"examples":[{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}]}},"required":["path","body"],"additionalProperties":false,"definitions":{"repository-rule-enforcement":{"type":"string","description":"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).","enum":["disabled","active","evaluate"]},"actions-policy-org-conditions":{"title":"Organization Actions policy conditions","type":"object","description":"Conditions for an organization Actions policy. The conditions object should contain one of\n`repository_name`, `repository_id`, or `repository_property`, and may also contain `workflow_path`.","oneOf":[{"allOf":[{"$ref":"#/definitions/repository-ruleset-conditions-repository-name-target"},{"$ref":"#/definitions/actions-policy-workflow-path-condition"}]},{"allOf":[{"$ref":"#/definitions/repository-ruleset-conditions-repository-id-target"},{"$ref":"#/definitions/actions-policy-workflow-path-condition"}]},{"allOf":[{"$ref":"#/definitions/repository-ruleset-conditions-repository-property-target"},{"$ref":"#/definitions/actions-policy-workflow-path-condition"}]}]},"actions-rule":{"title":"Actions Rule","type":"object","description":"An actions rule.","oneOf":[{"$ref":"#/definitions/actions-rule-restrict-actions-actors"},{"$ref":"#/definitions/actions-rule-restrict-action-events"}]},"repository-ruleset-conditions-repository-name-target":{"title":"Repository ruleset conditions for repository names","type":"object","description":"Parameters for a repository name condition","properties":{"repository_name":{"type":"object","properties":{"include":{"type":"array","description":"Array of repository names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~ALL` to include all repositories.","items":{"type":"string"}},"exclude":{"type":"array","description":"Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match.","items":{"type":"string"}},"protected":{"type":"boolean","description":"Whether renaming of target repositories is prevented."}}}},"required":["repository_name"]},"actions-policy-workflow-path-condition":{"title":"Actions policy workflow path condition","type":"object","description":"Parameters for an Actions policy workflow path condition. Omitting `workflow_path` when creating\na policy targets all workflows without storing an explicit condition. Omitting it when updating a\npolicy preserves the existing workflow targeting. For new or changed workflow conditions, the API\nrequires at least one included or excluded pattern. This is validated server-side rather than by\nthis schema, which can also describe existing stored conditions.","properties":{"workflow_path":{"type":"object","properties":{"include":{"type":"array","description":"Array of workflow file paths or glob patterns to include. An empty array includes all\nworkflows not matched by an excluded pattern. Use `~ALL` by itself to include all workflows.\n`~ALL` cannot be combined with other included patterns.","items":{"type":"string"}},"exclude":{"type":"array","description":"Array of workflow file paths or glob patterns to exclude. The condition will not pass\nif any of these patterns match. `~ALL` is not allowed in this array.","items":{"type":"string"}}},"required":["include","exclude"]}}},"repository-ruleset-conditions-repository-id-target":{"title":"Repository ruleset conditions for repository IDs","type":"object","description":"Parameters for a repository ID condition","properties":{"repository_id":{"type":"object","properties":{"repository_ids":{"type":"array","description":"The repository IDs that the ruleset applies to. One of these IDs must match for the condition to pass.","items":{"type":"integer"}}}}},"required":["repository_id"]},"repository-ruleset-conditions-repository-property-target":{"title":"Repository ruleset conditions for repository properties","type":"object","description":"Parameters for a repository property condition","properties":{"repository_property":{"type":"object","properties":{"include":{"type":"array","description":"The repository properties and values to include. All of these properties must match for the condition to pass.","items":{"$ref":"#/definitions/repository-ruleset-conditions-repository-property-spec"}},"exclude":{"type":"array","description":"The repository properties and values to exclude. The condition will not pass if any of these properties match.","items":{"$ref":"#/definitions/repository-ruleset-conditions-repository-property-spec"}}}}},"required":["repository_property"]},"actions-rule-restrict-actions-actors":{"title":"restrict_actions_actors","description":"Choose specific actors that are authorized to trigger Actions workflows.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["restrict_actions_actors"]},"parameters":{"type":"object","properties":{"allowed_actors":{"type":"array","description":"Select the actors who can run Actions workflows.","items":{"$ref":"#/definitions/actions-rule-params-actor"}}},"required":["allowed_actors"]}}},"actions-rule-restrict-action-events":{"title":"restrict_action_events","description":"Choose specific GitHub events that will trigger Actions workflows.","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["restrict_action_events"]},"parameters":{"type":"object","properties":{"allowed_events":{"type":"array","description":"Select the events that can trigger Actions workflows.","items":{"type":"string","enum":["branch_protection_rule","check_run","check_suite","create","delete","deployment","deployment_status","discussion","discussion_comment","fork","gollum","image_version","issue_comment","issues","label","merge_group","milestone","page_build","project","project_card","project_column","public","pull_request","pull_request_review","pull_request_review_comment","pull_request_target","push","registry_package","release","repository_dispatch","schedule","status","watch","workflow_call","workflow_dispatch","workflow_run"]}}},"required":["allowed_events"]}}},"repository-ruleset-conditions-repository-property-spec":{"title":"Repository ruleset property targeting definition","type":"object","description":"Parameters for a targeting a repository property","properties":{"name":{"type":"string","description":"The name of the repository property to target"},"property_values":{"type":"array","description":"The values to match for the repository property","items":{"type":"string"}},"source":{"type":"string","description":"The source of the repository property. Defaults to 'custom' if not specified.","enum":["custom","system"]}},"required":["name","property_values"]},"actions-rule-params-actor":{"title":"Actor","description":"An actor authorized to trigger Actions workflows","type":"object","properties":{"id":{"type":"integer","description":"ID of the actor authorized to trigger Actions workflows."},"type":{"type":"string","description":"The type of the actor","enum":["User","Bot","Team","BusinessTeam","EnterpriseTeam","IntegrationInstallation","App","RepositoryRole"]}},"required":["id","type"]}}},"name":"Create an organization Actions policy","id":"github.actions.create-org-actions-policy","example":{"path":{"org":"example"},"body":{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}},"maxRequests":1,"summary":false}}