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:
- The repository must be private or internal. Automations are not available in public repositories.
- Copilot облачный агент must be enabled for the repository. If you have Copilot Business or Копилот Энтерпрайз, an administrator must enable the Copilot облачный агент policy. See Управление доступом к облачному агенту GitHub Copilot.
- The organization must allow both Copilot облачный агент and automations in the repository (both are enabled by default). See Добавление облачного агента GitHub Copilot в вашу организацию.
Automations are available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Max, GitHub Copilot для бизнеса, and GitHub Copilot Enterprise plans.
Creating an automation
-
На GitHubперейдите на главную страницу репозитория.
-
Under your repository name, click Agents.
-
In the sidebar, click Automations.
-
Click Create new.
-
Enter a name for the automation.
-
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.
-
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.
-
Optionally, select the model you want Copilot to use. See Изменение модели ИИ для облачного агента GitHub Copilot.
-
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.
-
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.
- Open the automation you want to test from the Automations pane.
- 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.