{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Create an Actions policy for a repository.\nOmitting `workflow_path` targets all workflows without storing an explicit condition.","properties":{"path":{"type":"object","properties":{"owner":{"type":"string","description":"The account owner of the repository. The name is not case sensitive."},"repo":{"type":"string","description":"The name of the repository without the `.git` extension. The name is not case sensitive."}},"required":["owner","repo"],"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-repo-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-repo-conditions":{"title":"Repository Actions policy conditions","type":"object","description":"Conditions for a repository Actions policy. The object may be empty to preserve or use the\ndefault workflow targeting, or contain only `workflow_path`.","oneOf":[{"type":"object","maxProperties":0},{"allOf":[{"$ref":"#/definitions/actions-policy-workflow-path-condition"}],"required":["workflow_path"],"maxProperties":1}]},"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"}]},"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"]}}},"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"]}}},"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 a repository Actions policy","id":"github.actions.create-repo-actions-policy","example":{"path":{"owner":"octocat","repo":"hello-world"},"body":{"name":"Require approved actors","enforcement":"active","rules":[{"type":"restrict_actions_actors","parameters":{"allowed_actors":[{"id":1234,"type":"Team"}]}}]}},"maxRequests":1,"summary":false}}