{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"> [!NOTE]\n> This endpoint is in public preview and is subject to change.\n\nCreates a new automation in a repository. Personal automations are private to\ntheir creator. Shared automations are visible to anyone with read access to\nthe repository and manageable by anyone with write access to the repository.\n\nGitHub App installation access tokens can create shared automations by setting\n`type` to `shared`. The installation must belong to the repository owner and\nthe token must have \"Agent tasks\"\nrepository permissions (write). Personal automations require a user token.\nFor installation tokens, `created_by` identifies the App's bot account.\n\nTo call this endpoint, you must have write access to the repository and the\n\"Allow automations\" setting must be enabled for the repository.\n\nOAuth app tokens and personal access tokens (classic) need:\n\n* the `repo` scope for private or internal repositories\n* the `repo` scope or `public_repo` scope for public repositories\n\n**Fine-grained access tokens for \"Create an automation for a repository\"**\n\nThis endpoint works with the following fine-grained token types:\n\n* [GitHub App user access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)\n* [GitHub App installation access tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app)\n* [Fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)\n\nThe fine-grained token must have the following permission set:\n\n* \"Agent tasks\" repository permissions (write)\n","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. The name is not case sensitive."}},"required":["owner","repo"],"additionalProperties":false},"body":{"type":"object","description":"Request body for creating an automation.","required":["name","prompt"],"properties":{"name":{"type":"string","description":"The name of the automation."},"triggers":{"type":"object","additionalProperties":false,"description":"Trigger configuration for the automation.","properties":{"interval":{"type":"object","additionalProperties":false,"required":["cadence"],"properties":{"cadence":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["hourly","daily","weekly"]},"description":"One or more schedules on which the Automation runs."},"hour_utc":{"type":"integer","minimum":0,"maximum":23,"description":"UTC hour anchor (0 through 23) for daily and weekly schedules. Omitted daily and weekly values default to `0` (midnight UTC).","examples":[0]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"UTC weekday anchor for weekly schedules, where `0` is Sunday and `6` is Saturday. Omitted weekly values default to Monday (`1`).","examples":[0]},"minute_utc":{"type":"integer","enum":[0,15,30,45],"default":0,"description":"UTC minute anchor for daily and weekly schedules. Omitted daily and weekly values default to `0`. Must be omitted whenever `cadence` includes `hourly`."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Has no effect: scheduled runs can change any resource in the repository, and an organization or repository policy requiring trigger-scoped writes does not apply to them."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_opened":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_labeled":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"labels":{"type":"array","uniqueItems":true,"items":{"type":"string"},"description":"Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"workflow_run":{"type":"object","additionalProperties":false,"required":["workflows","conclusions"],"properties":{"workflows":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Workflow names matched against the name in each workflow YAML file."},"conclusions":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","enum":["failure"]},"description":"Workflow conclusions to match. The current trigger supports failure."},"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_opened":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_synchronize":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_merged":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_comment":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"body_substring":{"type":"string","description":"A case-insensitive substring matched against the event body."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_comment":{"type":"object","additionalProperties":false,"required":["comment_types"],"properties":{"comment_types":{"type":"array","minItems":1,"maxItems":2,"uniqueItems":true,"items":{"type":"string","enum":["timeline_comment","review_comment"]},"description":"Pull request conversation and inline review comment types to match."},"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"body_substring":{"type":"string","description":"A case-insensitive substring matched against the event body."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"discussion_opened":{"type":"object","additionalProperties":false,"properties":{"categories":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"Discussion category names matched case-insensitively."},"body_substring":{"type":"string","description":"A case-insensitive substring matched against the event body."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"discussion_updated":{"type":"object","additionalProperties":false,"properties":{"categories":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"Discussion category names matched case-insensitively."},"body_substring":{"type":"string","description":"A case-insensitive substring matched against the event body."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"discussion_comment":{"type":"object","additionalProperties":false,"properties":{"comment_types":{"type":"array","minItems":1,"maxItems":2,"uniqueItems":true,"items":{"type":"string","enum":["comment","reply"]},"description":"Top-level discussion comments and replies to match. Omit to match both."},"categories":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"Discussion category names matched case-insensitively."},"body_substring":{"type":"string","description":"A case-insensitive substring matched against the event body."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_assigned":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"assignees":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"Affected assignee logins matched case-insensitively."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_assigned":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"assignees":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"Affected assignee logins matched case-insensitively."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"sub_issue_added":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_ready_for_review":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_labeled":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"labels":{"type":"array","uniqueItems":true,"items":{"type":"string"},"description":"Label names matched case-insensitively against the label added by the event. Omit or use an empty array to match every added label."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_merge_conflict":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_review_submitted":{"type":"object","additionalProperties":false,"required":["states"],"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"states":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"string","enum":["approved","changes_requested","commented"]},"description":"Submitted review states to match."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_review_requested":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_closed":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"issue_reopened":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_closed":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_reopened":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_converted_to_draft":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_review_dismissed":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_review_thread_resolved":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"pull_request_review_thread_unresolved":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"description":"A GitHub issue or pull request search query."},"paths":{"type":"array","minItems":1,"items":{"type":"string","minLength":1},"description":"Gitignore-style changed-file path globs."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"automation_completed":{"type":"object","additionalProperties":false,"required":["automation_ids"],"properties":{"automation_ids":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"string"},"description":"Upstream Automation IDs in the same repository."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"automation_failed":{"type":"object","additionalProperties":false,"required":["automation_ids"],"properties":{"automation_ids":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"string"},"description":"Upstream Automation IDs in the same repository. An Automation cannot list itself, and a user-owned Automation can only be listed by its creator's user-owned Automations."},"reasons":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"string","enum":["reported","crashed","timed_out"]},"description":"Failure reasons to match. Omit to match only reported failures."},"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"code_scanning_alert":{"type":"object","additionalProperties":false,"description":"Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.","properties":{"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"secret_scanning_alert":{"type":"object","additionalProperties":false,"description":"Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.","properties":{"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}},"dependabot_alert":{"type":"object","additionalProperties":false,"description":"Runs on the default branch when a security alert of this kind is created in the repository. These are system events without an issue, pull request, or human actor, and cannot be run manually.","properties":{"write_scope":{"type":"string","enum":["trigger","repository"],"description":"Override the Automation `write_scope` for runs started by this trigger. If omitted, the automation's `write_scope` is used. Organization or repository policy may restrict the effective scope to `trigger`. Explicitly setting `repository` on create or edit returns 422 when policy validation is enabled and that policy applies."},"allow_copilot_triggers":{"type":"boolean","description":"When true, events Copilot creates, including from other automations and Copilot sessions, can start this automation through this trigger. Defaults to false. The Copilot coding agent app cannot turn it on: creating a trigger with true, or changing it from false to true, returns 422."}}}}},"prompt":{"type":"string","maxLength":10000,"description":"The prompt for the automation."},"model":{"type":"string","description":"The model to use for sessions triggered by this automation. Omit or leave empty to let the platform select the model."},"reasoning_effort":{"description":"The reasoning effort to use for sessions triggered by this automation. Omit or leave empty to use the model's default.","oneOf":[{"type":"string","maxLength":0},{"type":"string","enum":["none","low","medium","high","xhigh","max"]}]},"tools":{"type":"array","items":{"type":"string"},"description":"The tools available to the automation."},"enabled":{"type":"boolean","description":"Whether the automation should be created enabled. Defaults to true when omitted.","default":true},"type":{"type":"string","enum":["personal","shared"],"description":"The type of automation, fixed at creation. `personal` keeps it private to its creator and its runs act as that user. `shared` makes it belong to the repository, visible to anyone with read access to the repository and maintainable by anyone with write access to the repository, and its runs act as the Copilot app rather than as a person. `shared` is rejected when repository ownership is not available for the repository. Supported values: `personal`, `shared`. Defaults to `personal`.","default":"personal"},"require_actor_write_permission":{"type":"boolean","description":"When true, event-triggered runs require the event actor to have repo write permission, even when the org's allow_read_access_triggers policy is enabled. When policy validation is enabled, explicitly setting false returns 422 if effective organization or repository policy disallows read-access triggers. If omitted, defaults to false when policy permits read-access triggers, otherwise true. The actor requirement does not apply to interval-scheduled runs, which always run as the automation owner."},"continuous_history":{"type":"boolean","description":"When true, runs of this automation build on the session history of its previous runs, and runs of the same automation are serialized. Not tracked in revision history. Defaults to false."}},"examples":[{"name":"Issue triage","type":"personal","triggers":{"issue_opened":{"query":"is:open"}},"prompt":"Inspect the new issue and suggest labels, priority, and next steps.","tools":["github/get_file_contents","github/issue_read"],"model":"gpt-6-sol","reasoning_effort":"high"}]}},"required":["path","body"],"additionalProperties":false},"name":"Create an automation for a repository","id":"github.agent-automations.create-repo-automation","example":{"path":{"owner":"octocat","repo":"hello-world"},"body":{"name":"Issue triage","type":"personal","triggers":{"issue_opened":{"query":"is:open"}},"prompt":"Inspect the new issue and suggest labels, priority, and next steps.","tools":["github/get_file_contents","github/issue_read"],"model":"gpt-6-sol","reasoning_effort":"high"}},"maxRequests":1,"summary":false}}