Skip to main content

Creating automations with Copilot cloud agent

Create and manage automations to run Copilot облачный агент on a schedule or in response to events.

Кто может использовать эту функцию?

Automations are available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Max, GitHub Copilot для бизнеса, and GitHub Copilot Enterprise plans. Automations are available in private and internal repositories only. They are not available where they have been disabled by a repository administrator, in repositories owned by управляемые учетные записи пользователей, or where Copilot облачный агент is not enabled.
Sign up for Copilot

Introduction

With automations, you can set up Copilot облачный агент to run automatically, either on a schedule or in response to an event in a repository. Automations can take action within the repository where they are configured, such as opening a pull request or labeling an issue.

You can create and manage automations from the Agents tab of a repository on GitHub. You can also create and manage automations from the Automations tab in the GitHub приложение Copilot.

For an overview of automations, including triggers, tools, visibility, and security, see About Copilot automations.

Prerequisites

For automations to be available in a repository, all of the following must be true:

Automations are available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Max, GitHub Copilot для бизнеса, and GitHub Copilot Enterprise plans.

Creating an automation

  1. На GitHubперейдите на главную страницу репозитория.

  2. Under your repository name, click Agents.

  3. In the sidebar, click Automations.

  4. Click Create new.

  5. Enter a name for the automation.

  6. Select one or more triggers that determine when the automation runs:

    • On a schedule: choose a recurring interval, either hourly, daily, or weekly.
    • When an issue is created: the automation runs each time an issue is opened in the repository.
    • When a pull request is opened: the automation runs each time a pull request is opened in the repository.
    • When a pull request is synchronized: the automation runs each time new commits are pushed to a pull request in the repository.

    You can optionally configure filters for issue and pull request triggers:

    • For when an issue is created, add a search query filter.
    • For when a pull request is opened and when a pull request is synchronized, add a search query filter and a filter for files changed in the pull request.
  7. In the prompt field, describe the task you want Copilot to perform each time the automation runs.

    For example, Label this issue as a bug, an enhancement, or other, based on its content.

    Предупреждение

    The Copilot облачный агент sessions started by an automation are visible to others with access to the repository. Don't include secrets or other sensitive information in your prompt. To give Copilot access to sensitive values, use repository secrets. See Настройте секреты и переменные для облачного агента Copilot.

  8. Optionally, select the model you want Copilot to use. See Изменение модели ИИ для облачного агента GitHub Copilot.

  9. Select the tools Copilot can use when the automation runs, such as pushing changes, updating issue labels, or creating a pull request.

    Select only the tools the task requires. The tools you select control what actions Copilot can take in your repository. Optionally, you can use the Suggest tools button to ask Copilot to suggest tools based on your prompt. See About Copilot automations.

  10. Save the automation by clicking Create automation.

Testing an automation

You can run an automation immediately, without waiting for its trigger to fire, to check that it behaves as you expect.

  1. Open the automation you want to test from the Automations pane.
  2. Click the Run now button. Copilot starts a Copilot облачный агент session and runs the automation's prompt with the tools you selected. You can open the session to follow its progress and review any changes it makes.

Managing your Automations

Your automations are private to you, but the sessions started from your automations will be visible to everyone with read access to the repository.

From the Automations pane in a repository, you can:

  • View your automations for the repository and the sessions they have started.
  • Edit an automation to change its name, prompt, triggers, tools, or model.
  • Disable an automation to stop it running, or enable it again later.
  • Delete an automation you no longer need.

To see all of your automations across every repository, and navigate to manage each one, use the Automations view at the user level.

Further reading